From b1d794765fa37f7aaa89b0986c2bd8cfd43bd92a Mon Sep 17 00:00:00 2001 From: Shaun Arman Date: Sat, 4 Apr 2026 23:17:12 -0500 Subject: [PATCH] fix(ci): unblock release jobs and namespace linux artifacts by arch Drop fragile job-condition gates that were blocking release jobs, and upload linux artifacts with arch-prefixed release asset names so amd64 and arm64 outputs can coexist even when bundle filenames are identical. Made-with: Cursor --- .gitea/workflows/auto-tag.yml | 34 +++++++++---------- tests/unit/autoTagWorkflowTrigger.test.ts | 1 - ...easeWorkflowCrossPlatformArtifacts.test.ts | 6 ++-- 3 files changed, 19 insertions(+), 22 deletions(-) diff --git a/.gitea/workflows/auto-tag.yml b/.gitea/workflows/auto-tag.yml index a1f17446..2af1304e 100644 --- a/.gitea/workflows/auto-tag.yml +++ b/.gitea/workflows/auto-tag.yml @@ -61,7 +61,6 @@ jobs: build-linux-amd64: needs: autotag - if: needs.autotag.result == 'success' runs-on: linux-amd64 container: image: rust:1.88-slim @@ -121,14 +120,15 @@ jobs: fi printf '%s\n' "$ARTIFACTS" | while IFS= read -r f; do NAME=$(basename "$f") - echo "Uploading $NAME..." + UPLOAD_NAME="linux-amd64-$NAME" + echo "Uploading $UPLOAD_NAME..." EXISTING_IDS=$(curl -sf "$API/releases/$RELEASE_ID" \ -H "Authorization: token $RELEASE_TOKEN" \ - | jq -r --arg name "$NAME" '.assets[]? | select(.name == $name) | .id') + | jq -r --arg name "$UPLOAD_NAME" '.assets[]? | select(.name == $name) | .id') if [ -n "$EXISTING_IDS" ]; then printf '%s\n' "$EXISTING_IDS" | while IFS= read -r id; do [ -n "$id" ] || continue - echo "Deleting existing asset id=$id name=$NAME before upload..." + echo "Deleting existing asset id=$id name=$UPLOAD_NAME before upload..." curl -sf -X DELETE "$API/releases/$RELEASE_ID/assets/$id" \ -H "Authorization: token $RELEASE_TOKEN" done @@ -136,11 +136,11 @@ jobs: RESP_FILE=$(mktemp) HTTP_CODE=$(curl -sS -o "$RESP_FILE" -w "%{http_code}" -X POST "$API/releases/$RELEASE_ID/assets" \ -H "Authorization: token $RELEASE_TOKEN" \ - -F "attachment=@$f;filename=$NAME") + -F "attachment=@$f;filename=$UPLOAD_NAME") if [ "$HTTP_CODE" -ge 200 ] && [ "$HTTP_CODE" -lt 300 ]; then - echo "✓ Uploaded $NAME" + echo "✓ Uploaded $UPLOAD_NAME" else - echo "✗ Upload failed for $NAME (HTTP $HTTP_CODE)" + echo "✗ Upload failed for $UPLOAD_NAME (HTTP $HTTP_CODE)" python -c 'import pathlib,sys;print(pathlib.Path(sys.argv[1]).read_text(errors="replace")[:2000])' "$RESP_FILE" exit 1 fi @@ -148,7 +148,6 @@ jobs: build-windows-amd64: needs: autotag - if: needs.autotag.result == 'success' runs-on: linux-amd64 container: image: rust:1.88-slim @@ -239,7 +238,6 @@ jobs: build-macos-arm64: needs: autotag - if: needs.autotag.result == 'success' runs-on: macos-arm64 steps: - name: Checkout @@ -326,7 +324,6 @@ jobs: build-linux-arm64: needs: autotag - if: needs.autotag.result == 'success' runs-on: linux-arm64 container: image: rust:1.88-slim @@ -383,21 +380,22 @@ jobs: fi echo "Release ID: $RELEASE_ID" ARTIFACTS=$(find src-tauri/target/release/bundle -type f \ - \( -name "*arm64*.deb" -o -name "*aarch64*.deb" -o -name "*arm64*.rpm" -o -name "*aarch64*.rpm" -o -name "*arm64*.AppImage" -o -name "*aarch64*.AppImage" \)) + \( -name "*.deb" -o -name "*.rpm" -o -name "*.AppImage" \)) if [ -z "$ARTIFACTS" ]; then - echo "ERROR: No Linux arm64 artifacts were found to upload (arm64/aarch64 filename filter)." + echo "ERROR: No Linux arm64 artifacts were found to upload." exit 1 fi printf '%s\n' "$ARTIFACTS" | while IFS= read -r f; do NAME=$(basename "$f") - echo "Uploading $NAME..." + UPLOAD_NAME="linux-arm64-$NAME" + echo "Uploading $UPLOAD_NAME..." EXISTING_IDS=$(curl -sf "$API/releases/$RELEASE_ID" \ -H "Authorization: token $RELEASE_TOKEN" \ - | jq -r --arg name "$NAME" '.assets[]? | select(.name == $name) | .id') + | jq -r --arg name "$UPLOAD_NAME" '.assets[]? | select(.name == $name) | .id') if [ -n "$EXISTING_IDS" ]; then printf '%s\n' "$EXISTING_IDS" | while IFS= read -r id; do [ -n "$id" ] || continue - echo "Deleting existing asset id=$id name=$NAME before upload..." + echo "Deleting existing asset id=$id name=$UPLOAD_NAME before upload..." curl -sf -X DELETE "$API/releases/$RELEASE_ID/assets/$id" \ -H "Authorization: token $RELEASE_TOKEN" done @@ -405,11 +403,11 @@ jobs: RESP_FILE=$(mktemp) HTTP_CODE=$(curl -sS -o "$RESP_FILE" -w "%{http_code}" -X POST "$API/releases/$RELEASE_ID/assets" \ -H "Authorization: token $RELEASE_TOKEN" \ - -F "attachment=@$f;filename=$NAME") + -F "attachment=@$f;filename=$UPLOAD_NAME") if [ "$HTTP_CODE" -ge 200 ] && [ "$HTTP_CODE" -lt 300 ]; then - echo "✓ Uploaded $NAME" + echo "✓ Uploaded $UPLOAD_NAME" else - echo "✗ Upload failed for $NAME (HTTP $HTTP_CODE)" + echo "✗ Upload failed for $UPLOAD_NAME (HTTP $HTTP_CODE)" python -c 'import pathlib,sys;print(pathlib.Path(sys.argv[1]).read_text(errors="replace")[:2000])' "$RESP_FILE" exit 1 fi diff --git a/tests/unit/autoTagWorkflowTrigger.test.ts b/tests/unit/autoTagWorkflowTrigger.test.ts index e4dda6bc..1984c6f8 100644 --- a/tests/unit/autoTagWorkflowTrigger.test.ts +++ b/tests/unit/autoTagWorkflowTrigger.test.ts @@ -23,7 +23,6 @@ describe("auto-tag workflow release triggering", () => { expect(workflow).toContain("build-macos-arm64:"); expect(workflow).toContain("build-linux-arm64:"); expect(workflow).toContain("needs: autotag"); - expect(workflow).toContain("if: needs.autotag.result == 'success'"); expect(workflow).toContain("TAG=$(curl -s \"$API/tags?limit=50\""); expect(workflow).toContain("ERROR: Could not resolve release tag from repository tags."); }); diff --git a/tests/unit/releaseWorkflowCrossPlatformArtifacts.test.ts b/tests/unit/releaseWorkflowCrossPlatformArtifacts.test.ts index f15ae073..940041ec 100644 --- a/tests/unit/releaseWorkflowCrossPlatformArtifacts.test.ts +++ b/tests/unit/releaseWorkflowCrossPlatformArtifacts.test.ts @@ -19,9 +19,7 @@ describe("auto-tag release cross-platform artifact handling", () => { const workflow = readFileSync(autoTagWorkflowPath, "utf-8"); expect(workflow).toContain("ERROR: No Linux amd64 artifacts were found to upload."); - expect(workflow).toContain( - "ERROR: No Linux arm64 artifacts were found to upload (arm64/aarch64 filename filter).", - ); + expect(workflow).toContain("ERROR: No Linux arm64 artifacts were found to upload."); expect(workflow).toContain( "ERROR: linux-arm64 job is not running on an ARM64 host (uname -m=$ARCH).", ); @@ -42,5 +40,7 @@ describe("auto-tag release cross-platform artifact handling", () => { expect(workflow).toContain("Deleting existing asset id=$id name=$NAME before upload..."); expect(workflow).toContain("-X DELETE \"$API/releases/$RELEASE_ID/assets/$id\""); + expect(workflow).toContain("UPLOAD_NAME=\"linux-amd64-$NAME\""); + expect(workflow).toContain("UPLOAD_NAME=\"linux-arm64-$NAME\""); }); });