From 2f73237fd609ea6dcf0a98271ef20a406088899d Mon Sep 17 00:00:00 2001 From: git-echo Date: Wed, 27 May 2026 22:01:19 -0500 Subject: [PATCH] fix: Alpine build - truncated YAML and wrong abuild output path Root causes of ALL Alpine build failures: 1. ci.yml: Verify Alpine package step was TRUNCATED at line 339 - missing closing quote, then clause, fi, and entire upload step. This caused YAML parse failure every run. 2. build-alpine.sh: Copy path was /home/builduser/packages/home/x86_64/ but abuild outputs to /home/builduser/packages/builduser/x86_64/. The find fallback caught stale packages from previous builds. Fixes: - Complete the Verify Alpine package step with proper if/fi - Add Upload to Gitea Release step for Alpine (was completely missing) - Fix abuild output path in build-alpine.sh --- .gitea/workflows/ci.yml | 19 ++++++++++++++++++- build-alpine.sh | 3 ++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index eb0ca1f..cadf7cd 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -336,7 +336,24 @@ jobs: echo "Expected version: $EXPECTED_VERSION" echo "Package file: $FILE" # Verify filename contains expected version - if ! echo "$FILE" | grep -q "$EXPECTED_VERSION + if ! echo "$FILE" | grep -q "$EXPECTED_VERSION"; then + echo "ERROR: Alpine package version ($FILE) does not match expected version ($EXPECTED_VERSION)!" + exit 1 + fi + echo "Alpine package verification passed" + - name: Upload to Gitea Release + if: startsWith(github.ref, 'refs/tags/') + env: + GITEA_TOKEN: ${{ secrets.GITEATOKEN }} + run: | + TAG_NAME=${GITHUB_REF#refs/tags/} + FILE=$(ls releases/linux-patch-api-*.apk 2>/dev/null | head -1) + if [ -z "$FILE" ]; then + echo "ERROR: No Alpine package found for upload!" + exit 1 + fi + chmod +x scripts/upload-release.sh + ./scripts/upload-release.sh "$TAG_NAME" "$FILE" build-arch: name: Build Arch Package diff --git a/build-alpine.sh b/build-alpine.sh index f5b1168..df7330f 100644 --- a/build-alpine.sh +++ b/build-alpine.sh @@ -147,8 +147,9 @@ if [ "$(id -u)" = "0" ]; then su - builduser -c "cd $WORKSPACE_DIR && abuild checksum && abuild -d" # Copy APK from builduser packages to releases + # Note: abuild outputs to /home/builduser/packages/builduser/x86_64/ not /home/builduser/packages/home/x86_64/ mkdir -p releases - cp /home/builduser/packages/home/x86_64/*.apk releases/ 2>/dev/null || find /home/builduser/packages -name "*.apk" -exec cp {} releases/ \; 2>/dev/null || true + cp /home/builduser/packages/builduser/x86_64/*.apk releases/ 2>/dev/null || find /home/builduser/packages -name "*.apk" -exec cp {} releases/ \; 2>/dev/null || true else cd "$WORKSPACE_DIR" abuild checksum