Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions .github/workflows/publish-release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,23 @@ jobs:
build-and-upload:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
suffix: linux
goos: linux
goarch: amd64
- os: ubuntu-latest
goos: linux
goarch: arm64
- os: macos-latest
goos: darwin
goarch: amd64
- os: macos-latest
goos: darwin
goarch: arm64
- os: windows-latest
suffix: windows
goos: windows
goarch: amd64
extension: .exe
- os: macos-latest
suffix: darwin

runs-on: ${{matrix.os}}

Expand All @@ -33,16 +41,20 @@ jobs:
go-version: "1.23"

- name: Build
run: go build -v .
run: go build -v -o keep-sorted${{matrix.extension}} .
env:
GOOS: ${{matrix.goos}}
GOARCH: ${{matrix.goarch}}
CGO_ENABLED: "0"

- name: Test
run: go test -v ./...

- name: Upload Artifacts to Release
run: |
echo Uploading ${{matrix.suffix}} artifact for ${GITHUB_REF_NAME}
mv keep-sorted${{matrix.extension}} keep-sorted_${{matrix.suffix}}${{matrix.extension}}
gh release upload ${GITHUB_REF_NAME} keep-sorted_${{matrix.suffix}}${{matrix.extension}} --clobber
echo Uploading ${{matrix.goos}}_${{matrix.goarch}} artifact for ${GITHUB_REF_NAME}
mv keep-sorted${{matrix.extension}} keep-sorted_${{matrix.goos}}_${{matrix.goarch}}${{matrix.extension}}
gh release upload ${GITHUB_REF_NAME} keep-sorted_${{matrix.goos}}_${{matrix.goarch}}${{matrix.extension}} --clobber
shell: bash
env:
GH_TOKEN: ${{ github.token }}
Loading