Skip to content

Commit a7f24ba

Browse files
authored
feat: add APK package for Alpine Linux to release workflow (#75)
* feat: add APK package for Alpine Linux to release workflow Closes #66 * 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. * 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.
1 parent e091276 commit a7f24ba

2 files changed

Lines changed: 67 additions & 3 deletions

File tree

.github/workflows/release-drafter.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ name: Release Drafter
33
on:
44
push:
55
branches: [main, master]
6-
pull_request:
7-
types: [opened, reopened, synchronize]
86

97
permissions:
108
contents: write

.github/workflows/release.yml

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,71 @@ jobs:
438438
--repo "${{ github.repository }}" \
439439
--clobber
440440
441+
# ── Build and upload .apk packages ────────────────────────────────
442+
# Generates Alpine Linux packages for x86_64 and aarch64 using nfpm.
443+
# Each arch is independent — one failing arch does not block the other.
444+
package-apk:
445+
name: Package APK (${{ matrix.goarch }})
446+
needs: release
447+
runs-on: ubuntu-latest
448+
strategy:
449+
fail-fast: false
450+
matrix:
451+
include:
452+
- goarch: amd64
453+
asset: sql-pipe-x86_64-linux
454+
- goarch: arm64
455+
asset: sql-pipe-aarch64-linux
456+
457+
permissions:
458+
contents: write
459+
460+
steps:
461+
- uses: actions/checkout@v6
462+
463+
- name: Download all artifacts
464+
uses: actions/download-artifact@v8
465+
with:
466+
path: artifacts/
467+
merge-multiple: true
468+
469+
- name: Install nfpm
470+
run: |
471+
NFPM_VERSION=2.45.1
472+
curl -sfL -o /tmp/nfpm.tar.gz \
473+
"https://github.com/goreleaser/nfpm/releases/download/v${NFPM_VERSION}/nfpm_${NFPM_VERSION}_Linux_x86_64.tar.gz"
474+
tar -xzf /tmp/nfpm.tar.gz -C /usr/local/bin nfpm
475+
476+
- name: Stage files for packaging
477+
run: |
478+
mkdir -p pkg-work
479+
cp artifacts/${{ matrix.asset }} pkg-work/sql-pipe
480+
chmod +x pkg-work/sql-pipe
481+
cp artifacts/sql-pipe.1.gz pkg-work/sql-pipe.1.gz
482+
cp LICENSE pkg-work/LICENSE
483+
484+
- name: Build .apk
485+
working-directory: pkg-work
486+
env:
487+
VERSION: ${{ github.ref_name }}
488+
GOARCH: ${{ matrix.goarch }}
489+
run: |
490+
VERSION="${VERSION#v}"
491+
mkdir -p dist
492+
VERSION="$VERSION" GOARCH="$GOARCH" \
493+
nfpm package -p apk \
494+
-f "$GITHUB_WORKSPACE/packaging/nfpm.yaml" \
495+
-t dist/
496+
497+
- name: Upload .apk to GitHub Release
498+
env:
499+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
500+
working-directory: pkg-work
501+
run: |
502+
gh release upload "${{ github.ref_name }}" dist/*.apk \
503+
--repo "${{ github.repository }}" \
504+
--clobber
505+
441506
# ── Build and upload Chocolatey package ────────────────────────────
442507
# Creates a .nupkg for Windows (x86 + x86_64) and uploads it to the
443508
# GitHub Release. If CHOCOLATEY_API_KEY is set, also pushes to the
@@ -623,12 +688,13 @@ jobs:
623688
# binaries, man page, .deb, .rpm AND .nupkg packages.
624689
checksums:
625690
name: Generate SHA256 checksums
626-
needs: [release, package-deb, package-rpm, package-choco]
691+
needs: [release, package-deb, package-rpm, package-apk, package-choco]
627692
if: >-
628693
always()
629694
&& needs.release.result == 'success'
630695
&& (needs.package-deb.result == 'success' || needs.package-deb.result == 'skipped')
631696
&& (needs.package-rpm.result == 'success' || needs.package-rpm.result == 'skipped')
697+
&& (needs.package-apk.result == 'success' || needs.package-apk.result == 'skipped')
632698
&& (needs.package-choco.result == 'success' || needs.package-choco.result == 'skipped')
633699
runs-on: ubuntu-latest
634700
permissions:

0 commit comments

Comments
 (0)