mirror of
https://github.com/ThisIsDara/mhr-cfw-go.git
synced 2026-05-17 21:24:36 +03:00
Update workflow: build for both Windows and Linux
This commit is contained in:
@@ -7,7 +7,10 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
@@ -18,25 +21,47 @@ jobs:
|
||||
with:
|
||||
go-version: '1.22'
|
||||
|
||||
- name: Build
|
||||
run: go build -ldflags "-s -w" -o mhr-cfw-go.exe ./cmd/mhr-cfw
|
||||
- name: Build Linux
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
run: GOOS=linux go build -ldflags "-s -w" -o mhr-cfw-go ./cmd/mhr-cfw
|
||||
|
||||
- name: Build Windows
|
||||
if: matrix.os == 'windows-latest'
|
||||
run: GOOS=windows go build -ldflags "-s -w" -o mhr-cfw-go.exe ./cmd/mhr-cfw
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: mhr-cfw-go
|
||||
path: mhr-cfw-go.exe
|
||||
name: mhr-cfw-go-${{ matrix.os }}
|
||||
path: mhr-cfw-go*
|
||||
|
||||
- name: Download artifact
|
||||
release:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Download Linux artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: mhr-cfw-go
|
||||
name: mhr-cfw-go-ubuntu-latest
|
||||
path: .
|
||||
|
||||
- name: Download Windows artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: mhr-cfw-go-windows-latest
|
||||
path: .
|
||||
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: mhr-cfw-go.exe
|
||||
files: |
|
||||
mhr-cfw-go
|
||||
mhr-cfw-go.exe
|
||||
body: "Built from commit ${{ github.sha }}"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
Reference in New Issue
Block a user