From c94e57d9ba0e6cfa7c37a4f38570c656dbf6ed2a Mon Sep 17 00:00:00 2001 From: Elias Kohout Date: Thu, 2 Apr 2026 03:16:29 +0200 Subject: [PATCH] fix: clean up apk-publish workflow Co-Authored-By: Claude Sonnet 4.6 --- .gitea/workflows/apk-publish.yml | 51 +++++++++++--------------------- 1 file changed, 18 insertions(+), 33 deletions(-) diff --git a/.gitea/workflows/apk-publish.yml b/.gitea/workflows/apk-publish.yml index 2821f5d..ea9bd89 100644 --- a/.gitea/workflows/apk-publish.yml +++ b/.gitea/workflows/apk-publish.yml @@ -11,64 +11,49 @@ jobs: container: image: alpine:latest steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install build dependencies run: | - apk add --no-cache git go abuild make nodejs curl openssl sudo - + apk add --no-cache git go abuild curl sudo + - name: Create build user run: | adduser -D -G abuild build echo "build ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers chown -R build:abuild . - - - name: Checkout repository - uses: actions/checkout@v4 - + - name: Configure git safe directory run: git config --global --add safe.directory "$PWD" - + - name: Setup abuild for package signing run: | su build -c "abuild-keygen -a -n" cp /home/build/.abuild/*.pub /etc/apk/keys/ - + - name: Prepare source run: | pkgver=$(echo "${{ github.ref_name }}" | sed 's/^v//') pkgname="axolotl" - - cd packaging/alpine - sed -i "s/pkgver=.*/pkgver=$pkgver/" APKBUILD - - cd ../.. + + sed -i "s/pkgver=.*/pkgver=$pkgver/" packaging/alpine/APKBUILD + git archive --format=tar.gz --prefix="$pkgname-$pkgver/" -o "packaging/alpine/$pkgname-$pkgver.tar.gz" HEAD - + sed -i "s|source=.*|source=\"\$pkgname-\$pkgver.tar.gz\"|" packaging/alpine/APKBUILD chown -R build:abuild . - - - name: Update apk index - run: apk update - + - name: Generate checksums - run: | - cd packaging/alpine - su build -c "abuild checksum" - + run: su build -c "cd $PWD/packaging/alpine && abuild checksum" + - name: Build package - run: | - cd packaging/alpine - su build -c "abuild -r" - - - name: Find built package - id: find_package - run: | - find ~build/packages -name "*.apk" -type f > packages.txt - echo "package_path=$(head -1 packages.txt)" >> $GITHUB_OUTPUT - + run: su build -c "cd $PWD/packaging/alpine && abuild -r" + - name: Publish to Gitea Registry run: | apk_file=$(find ~build/packages -name "*.apk" -type f | head -1) - curl -X PUT \ + curl --fail-with-body -X PUT \ -H "Authorization: token ${{ secrets.ACCESS_TOKEN }}" \ -T "$apk_file" \ "${{ github.server_url }}/api/packages/${{ github.repository_owner }}/alpine"