From 4788342958a30d5f50204ee9e88be36ade0e029b Mon Sep 17 00:00:00 2001 From: Jabberwocky238 <7176656@qq.com> Date: Thu, 30 Jul 2026 03:07:41 -0400 Subject: [PATCH] build release artifacts in one CI job --- .github/workflows/deploy.yml | 44 ++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 281460e..8a8c605 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -10,21 +10,8 @@ permissions: jobs: build: - name: Build ${{ matrix.goos }}-${{ matrix.goarch }} + name: Build binaries runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: - - goos: linux - goarch: amd64 - suffix: "" - - goos: darwin - goarch: amd64 - suffix: "" - - goos: windows - goarch: amd64 - suffix: .exe steps: - name: Check out source @@ -42,14 +29,31 @@ jobs: - name: Build env: CGO_ENABLED: "0" - GOOS: ${{ matrix.goos }} - GOARCH: ${{ matrix.goarch }} - run: go build -trimpath -ldflags="-s -w" -o "dist/simplegit-${GOOS}-${GOARCH}${{ matrix.suffix }}" ./cmd + run: | + GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o dist/simplegit-linux-amd64 ./cmd + GOOS=darwin GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o dist/simplegit-darwin-amd64 ./cmd + GOOS=windows GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o dist/simplegit-windows-amd64.exe ./cmd - - name: Upload binary + - name: Upload Linux binary uses: actions/upload-artifact@v4 with: - name: simplegit-${{ matrix.goos }}-${{ matrix.goarch }} - path: dist/simplegit-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.suffix }} + name: simplegit-linux-amd64 + path: dist/simplegit-linux-amd64 + if-no-files-found: error + retention-days: 14 + + - name: Upload macOS binary + uses: actions/upload-artifact@v4 + with: + name: simplegit-darwin-amd64 + path: dist/simplegit-darwin-amd64 + if-no-files-found: error + retention-days: 14 + + - name: Upload Windows binary + uses: actions/upload-artifact@v4 + with: + name: simplegit-windows-amd64 + path: dist/simplegit-windows-amd64.exe if-no-files-found: error retention-days: 14