build release artifacts in one CI job

This commit is contained in:
Jabberwocky238
2026-07-30 03:07:41 -04:00
parent b321bf533f
commit 4788342958
+24 -20
View File
@@ -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