build release artifacts in one CI job
This commit is contained in:
@@ -10,21 +10,8 @@ permissions:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Build ${{ matrix.goos }}-${{ matrix.goarch }}
|
name: Build binaries
|
||||||
runs-on: ubuntu-latest
|
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:
|
steps:
|
||||||
- name: Check out source
|
- name: Check out source
|
||||||
@@ -42,14 +29,31 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
env:
|
env:
|
||||||
CGO_ENABLED: "0"
|
CGO_ENABLED: "0"
|
||||||
GOOS: ${{ matrix.goos }}
|
run: |
|
||||||
GOARCH: ${{ matrix.goarch }}
|
GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o dist/simplegit-linux-amd64 ./cmd
|
||||||
run: go build -trimpath -ldflags="-s -w" -o "dist/simplegit-${GOOS}-${GOARCH}${{ matrix.suffix }}" ./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
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: simplegit-${{ matrix.goos }}-${{ matrix.goarch }}
|
name: simplegit-linux-amd64
|
||||||
path: dist/simplegit-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.suffix }}
|
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
|
if-no-files-found: error
|
||||||
retention-days: 14
|
retention-days: 14
|
||||||
|
|||||||
Reference in New Issue
Block a user