fix: clean up apk-publish workflow
Some checks failed
Build and Publish APK Package / build-apk (push) Failing after 2s
Build and Push Docker Container / build-and-push (push) Has been cancelled

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-02 03:16:29 +02:00
parent 53883c04f1
commit c94e57d9ba

View File

@@ -11,9 +11,12 @@ jobs:
container: container:
image: alpine:latest image: alpine:latest
steps: steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install build dependencies - name: Install build dependencies
run: | 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 - name: Create build user
run: | run: |
@@ -21,9 +24,6 @@ jobs:
echo "build ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers echo "build ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
chown -R build:abuild . chown -R build:abuild .
- name: Checkout repository
uses: actions/checkout@v4
- name: Configure git safe directory - name: Configure git safe directory
run: git config --global --add safe.directory "$PWD" run: git config --global --add safe.directory "$PWD"
@@ -37,38 +37,23 @@ jobs:
pkgver=$(echo "${{ github.ref_name }}" | sed 's/^v//') pkgver=$(echo "${{ github.ref_name }}" | sed 's/^v//')
pkgname="axolotl" pkgname="axolotl"
cd packaging/alpine sed -i "s/pkgver=.*/pkgver=$pkgver/" packaging/alpine/APKBUILD
sed -i "s/pkgver=.*/pkgver=$pkgver/" APKBUILD
cd ../..
git archive --format=tar.gz --prefix="$pkgname-$pkgver/" -o "packaging/alpine/$pkgname-$pkgver.tar.gz" HEAD 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 sed -i "s|source=.*|source=\"\$pkgname-\$pkgver.tar.gz\"|" packaging/alpine/APKBUILD
chown -R build:abuild . chown -R build:abuild .
- name: Update apk index
run: apk update
- name: Generate checksums - name: Generate checksums
run: | run: su build -c "cd $PWD/packaging/alpine && abuild checksum"
cd packaging/alpine
su build -c "abuild checksum"
- name: Build package - name: Build package
run: | run: su build -c "cd $PWD/packaging/alpine && abuild -r"
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
- name: Publish to Gitea Registry - name: Publish to Gitea Registry
run: | run: |
apk_file=$(find ~build/packages -name "*.apk" -type f | head -1) 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 }}" \ -H "Authorization: token ${{ secrets.ACCESS_TOKEN }}" \
-T "$apk_file" \ -T "$apk_file" \
"${{ github.server_url }}/api/packages/${{ github.repository_owner }}/alpine" "${{ github.server_url }}/api/packages/${{ github.repository_owner }}/alpine"