From dab2540303a49872413107dfe2868488cd656b23 Mon Sep 17 00:00:00 2001 From: Hongxin Liang Date: Mon, 1 Jun 2026 12:10:51 +0200 Subject: [PATCH 1/2] feat: add multi-architecture release artifacts Add explicit GOOS/GOARCH cross-compilation to the release workflow, producing binaries for linux/amd64, linux/arm64, darwin/amd64, darwin/arm64, and windows/amd64. --- .../workflows/publish-release-artifacts.yml | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-release-artifacts.yml b/.github/workflows/publish-release-artifacts.yml index 7d16a3e..d2865b0 100644 --- a/.github/workflows/publish-release-artifacts.yml +++ b/.github/workflows/publish-release-artifacts.yml @@ -8,15 +8,28 @@ jobs: build-and-upload: strategy: matrix: - os: [ubuntu-latest, windows-latest, macos-latest] include: - os: ubuntu-latest - suffix: linux + goos: linux + goarch: amd64 + suffix: linux_amd64 + - os: ubuntu-latest + goos: linux + goarch: arm64 + suffix: linux_arm64 + - os: macos-latest + goos: darwin + goarch: amd64 + suffix: darwin_amd64 + - os: macos-latest + goos: darwin + goarch: arm64 + suffix: darwin_arm64 - os: windows-latest - suffix: windows + goos: windows + goarch: amd64 + suffix: windows_amd64 extension: .exe - - os: macos-latest - suffix: darwin runs-on: ${{matrix.os}} @@ -33,7 +46,11 @@ 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 ./... From 641964e7477ad4ce013b030ace905d11e5d2ffc3 Mon Sep 17 00:00:00 2001 From: Hongxin Liang Date: Fri, 5 Jun 2026 19:30:57 +0200 Subject: [PATCH 2/2] No suffix --- .github/workflows/publish-release-artifacts.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish-release-artifacts.yml b/.github/workflows/publish-release-artifacts.yml index d2865b0..c080b6a 100644 --- a/.github/workflows/publish-release-artifacts.yml +++ b/.github/workflows/publish-release-artifacts.yml @@ -12,23 +12,18 @@ jobs: - os: ubuntu-latest goos: linux goarch: amd64 - suffix: linux_amd64 - os: ubuntu-latest goos: linux goarch: arm64 - suffix: linux_arm64 - os: macos-latest goos: darwin goarch: amd64 - suffix: darwin_amd64 - os: macos-latest goos: darwin goarch: arm64 - suffix: darwin_arm64 - os: windows-latest goos: windows goarch: amd64 - suffix: windows_amd64 extension: .exe runs-on: ${{matrix.os}} @@ -57,9 +52,9 @@ jobs: - 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 }}