From 3a6bcba4528757777c39662a4a3e84f7dffca5bb Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 25 Mar 2026 19:38:07 +0000 Subject: [PATCH] feat: add GitHub Actions release workflow with multi-platform binary builds Co-authored-by: torgiren <1117481+torgiren@users.noreply.github.com> Agent-Logs-Url: https://github.com/torgiren/ksef-cli/sessions/8b555ca7-815f-4fd0-b773-c59ef0536491 --- .github/workflows/release.yml | 91 +++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..1618b83 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,91 @@ +# This workflow builds cross-platform binaries and publishes a GitHub Release +# when a version tag (e.g. v1.2.3) is pushed. + +name: Release + +on: + push: + tags: + - 'v*' + +jobs: + + test: + name: Test + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.26' + + - name: Test + run: go test -v ./... + + build: + name: Build (${{ matrix.goos }}/${{ matrix.goarch }}) + runs-on: ubuntu-latest + needs: test + permissions: + contents: read + strategy: + matrix: + include: + - goos: linux + goarch: amd64 + - goos: linux + goarch: arm64 + - goos: darwin + goarch: amd64 + - goos: darwin + goarch: arm64 + - goos: windows + goarch: amd64 + + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.26' + + - name: Build binary + env: + GOOS: ${{ matrix.goos }} + GOARCH: ${{ matrix.goarch }} + run: | + OUTPUT="ksef-cli-${{ matrix.goos }}-${{ matrix.goarch }}" + if [ "${{ matrix.goos }}" = "windows" ]; then + OUTPUT="${OUTPUT}.exe" + fi + go build -o "${OUTPUT}" . + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: ksef-cli-${{ matrix.goos }}-${{ matrix.goarch }} + path: ksef-cli-${{ matrix.goos }}-${{ matrix.goarch }}* + + release: + name: Create GitHub Release + needs: build + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + merge-multiple: true + + - name: Create release and upload binaries + uses: softprops/action-gh-release@v2 + with: + files: artifacts/*