🐛 添加构建工作流

This commit is contained in:
远野千束 2024-10-02 23:25:22 +08:00
parent e7ae5e1fcf
commit a77c29a136

View File

@ -21,8 +21,8 @@ jobs:
strategy: strategy:
matrix: matrix:
go-version: [1.22] go-version: [1.22]
os: [ubuntu-latest, windows-latest] os: [ubuntu-latest, windows-latest, macos-latest]
arch: [ "amd64", "arm64", "arm", "386" ] arch: [amd64, arm64, arm, 386, ppc64, ppc64le, mips, mipsle, mips64, mips64le, s390x, riscv64]
steps: steps:
- name: Checkout code - name: Checkout code
@ -41,12 +41,13 @@ jobs:
- name: Build - name: Build
run: | run: |
GOOS=${{ matrix.os == 'ubuntu-latest' && 'linux' || matrix.os == 'windows-latest' && 'windows'}} GOOS=${{ matrix.os == 'ubuntu-latest' && 'linux' || matrix.os == 'windows-latest' && 'windows' || 'darwin' }}
GOARCH=${{ matrix.arch }} GOARCH=${{ matrix.arch }}
go build -o build/${{ matrix.os }}/server-status-server go build -o build/${{ matrix.os }}-${{ matrix.arch }}/server-status-server cmd/main.go
- name: Upload binaries - name: Upload binaries
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: server-status-server-${{ matrix.os }}-${{ matrix.go-version }} name: server-status-server-${{ matrix.os }}-${{ matrix.arch }}
path: build/${{ matrix.os }}/server-status-server path: build/${{ matrix.os }}-${{ matrix.arch }}/server-status-server
if-no-files-found: warn