From e27941f8d96770b270f3827270caf1921f7aef30 Mon Sep 17 00:00:00 2001 From: "Victor M. Varela" Date: Fri, 20 Mar 2026 01:43:38 +0100 Subject: [PATCH 1/3] feat: add APK package for Alpine Linux to release workflow Closes #66 --- .github/workflows/release.yml | 68 ++++++++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1675510..80821de 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -438,6 +438,71 @@ jobs: --repo "${{ github.repository }}" \ --clobber + # ── Build and upload .apk packages ──────────────────────────────── + # Generates Alpine Linux packages for x86_64 and aarch64 using nfpm. + # Each arch is independent — one failing arch does not block the other. + package-apk: + name: Package APK (${{ matrix.goarch }}) + needs: release + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - goarch: amd64 + asset: sql-pipe-x86_64-linux + - goarch: arm64 + asset: sql-pipe-aarch64-linux + + permissions: + contents: write + + steps: + - uses: actions/checkout@v6 + + - name: Download all artifacts + uses: actions/download-artifact@v8 + with: + path: artifacts/ + merge-multiple: true + + - name: Install nfpm + run: | + NFPM_VERSION=2.45.1 + curl -sfL -o /tmp/nfpm.tar.gz \ + "https://github.com/goreleaser/nfpm/releases/download/v${NFPM_VERSION}/nfpm_${NFPM_VERSION}_Linux_x86_64.tar.gz" + tar -xzf /tmp/nfpm.tar.gz -C /usr/local/bin nfpm + + - name: Stage files for packaging + run: | + mkdir -p pkg-work + cp artifacts/${{ matrix.asset }} pkg-work/sql-pipe + chmod +x pkg-work/sql-pipe + cp artifacts/sql-pipe.1.gz pkg-work/sql-pipe.1.gz + cp LICENSE pkg-work/LICENSE + + - name: Build .apk + working-directory: pkg-work + env: + VERSION: ${{ github.ref_name }} + GOARCH: ${{ matrix.goarch }} + run: | + VERSION="${VERSION#v}" + mkdir -p dist + VERSION="$VERSION" GOARCH="$GOARCH" \ + nfpm package -p apk \ + -f "$GITHUB_WORKSPACE/packaging/nfpm.yaml" \ + -t dist/ + + - name: Upload .apk to GitHub Release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + working-directory: pkg-work + run: | + gh release upload "${{ github.ref_name }}" dist/*.apk \ + --repo "${{ github.repository }}" \ + --clobber + # ── Build and upload Chocolatey package ──────────────────────────── # Creates a .nupkg for Windows (x86 + x86_64) and uploads it to the # GitHub Release. If CHOCOLATEY_API_KEY is set, also pushes to the @@ -623,12 +688,13 @@ jobs: # binaries, man page, .deb, .rpm AND .nupkg packages. checksums: name: Generate SHA256 checksums - needs: [release, package-deb, package-rpm, package-choco] + needs: [release, package-deb, package-rpm, package-apk, package-choco] if: >- always() && needs.release.result == 'success' && (needs.package-deb.result == 'success' || needs.package-deb.result == 'skipped') && (needs.package-rpm.result == 'success' || needs.package-rpm.result == 'skipped') + && (needs.package-apk.result == 'success' || needs.package-apk.result == 'skipped') && (needs.package-choco.result == 'success' || needs.package-choco.result == 'skipped') runs-on: ubuntu-latest permissions: From 727d940d921a646efb7bfec1ecde8cbd70f8ca18 Mon Sep 17 00:00:00 2001 From: "Victor M. Varela" Date: Fri, 20 Mar 2026 01:47:03 +0100 Subject: [PATCH 2/3] fix(ci): disable release update on pull_request events in release-drafter On PR events the target_commitish resolves to refs/pull/N/merge which is invalid for a release update. Use disable-releaser on PR events so only auto-labeling runs; the draft is updated only on push to master. --- .github/workflows/release-drafter.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index cd7de32..13070aa 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -15,5 +15,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: release-drafter/release-drafter@v7 + with: + # On pull_request events, only apply auto-labels — do not update + # the draft release, as the PR merge commit is not a valid + # target_commitish for a release. + disable-releaser: ${{ github.event_name == 'pull_request' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From bd82eeb5d8dbabc726d1948440c60ce48a7dfd94 Mon Sep 17 00:00:00 2001 From: "Victor M. Varela" Date: Fri, 20 Mar 2026 01:47:58 +0100 Subject: [PATCH 3/3] fix(ci): remove pull_request trigger from release-drafter workflow The pull_request event causes release-drafter to attempt updating the draft release with refs/pull/N/merge as target_commitish, which the GitHub API rejects as invalid. Since the config has no autolabeler rules, the pull_request trigger provided no value. The draft is now only updated on push to master. --- .github/workflows/release-drafter.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 13070aa..f15fd47 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -3,8 +3,6 @@ name: Release Drafter on: push: branches: [main, master] - pull_request: - types: [opened, reopened, synchronize] permissions: contents: write @@ -15,10 +13,5 @@ jobs: runs-on: ubuntu-latest steps: - uses: release-drafter/release-drafter@v7 - with: - # On pull_request events, only apply auto-labels — do not update - # the draft release, as the PR merge commit is not a valid - # target_commitish for a release. - disable-releaser: ${{ github.event_name == 'pull_request' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}