From c3fd83f33084d8f92056d98bc7ed028a1089222b Mon Sep 17 00:00:00 2001 From: Shaun Arman Date: Sat, 4 Apr 2026 19:53:40 -0500 Subject: [PATCH] fix(ci): make release artifacts reliable across platforms Override OpenSSL vendoring for the windows-gnu release build so cross-compiles no longer fail on pkg-config lookup, and fail fast when Linux release jobs produce no artifacts so incomplete releases are detected immediately. Made-with: Cursor --- .gitea/workflows/release.yml | 20 ++++++++++++---- ...easeWorkflowCrossPlatformArtifacts.test.ts | 24 +++++++++++++++++++ 2 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 tests/unit/releaseWorkflowCrossPlatformArtifacts.test.ts diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 03ad0dc8..40ebb19d 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -50,8 +50,13 @@ jobs: exit 1 fi echo "Release ID: $RELEASE_ID" - find src-tauri/target/x86_64-unknown-linux-gnu/release/bundle \ - \( -name "*.deb" -o -name "*.rpm" -o -name "*.AppImage" \) | while read f; do + ARTIFACTS=$(find src-tauri/target/x86_64-unknown-linux-gnu/release/bundle -type f \ + \( -name "*.deb" -o -name "*.rpm" -o -name "*.AppImage" \)) + if [ -z "$ARTIFACTS" ]; then + echo "ERROR: No Linux amd64 artifacts were found to upload." + exit 1 + fi + printf '%s\n' "$ARTIFACTS" | while IFS= read -r f; do echo "Uploading $(basename $f)..." curl -sf -X POST "$API/releases/$RELEASE_ID/assets" \ -H "Authorization: token $RELEASE_TOKEN" \ @@ -81,6 +86,8 @@ jobs: CXX_x86_64_pc_windows_gnu: x86_64-w64-mingw32-g++ AR_x86_64_pc_windows_gnu: x86_64-w64-mingw32-ar CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER: x86_64-w64-mingw32-gcc + OPENSSL_NO_VENDOR: "0" + OPENSSL_STATIC: "1" run: | npm ci --legacy-peer-deps rustup target add x86_64-pc-windows-gnu @@ -217,8 +224,13 @@ jobs: exit 1 fi echo "Release ID: $RELEASE_ID" - find src-tauri/target/release/bundle \ - \( -name "*.deb" -o -name "*.rpm" -o -name "*.AppImage" \) | while read f; do + ARTIFACTS=$(find src-tauri/target/release/bundle -type f \ + \( -name "*.deb" -o -name "*.rpm" -o -name "*.AppImage" \)) + if [ -z "$ARTIFACTS" ]; then + echo "ERROR: No Linux arm64 artifacts were found to upload." + exit 1 + fi + printf '%s\n' "$ARTIFACTS" | while IFS= read -r f; do echo "Uploading $(basename $f)..." curl -sf -X POST "$API/releases/$RELEASE_ID/assets" \ -H "Authorization: token $RELEASE_TOKEN" \ diff --git a/tests/unit/releaseWorkflowCrossPlatformArtifacts.test.ts b/tests/unit/releaseWorkflowCrossPlatformArtifacts.test.ts new file mode 100644 index 00000000..31a792ee --- /dev/null +++ b/tests/unit/releaseWorkflowCrossPlatformArtifacts.test.ts @@ -0,0 +1,24 @@ +import { describe, expect, it } from "vitest"; +import { readFileSync } from "node:fs"; +import path from "node:path"; + +const releaseWorkflowPath = path.resolve( + process.cwd(), + ".gitea/workflows/release.yml", +); + +describe("release workflow cross-platform artifact handling", () => { + it("overrides OpenSSL vendoring for windows-gnu cross builds", () => { + const workflow = readFileSync(releaseWorkflowPath, "utf-8"); + + expect(workflow).toContain("OPENSSL_NO_VENDOR: \"0\""); + expect(workflow).toContain("OPENSSL_STATIC: \"1\""); + }); + + it("fails linux uploads when no artifacts are found", () => { + const workflow = readFileSync(releaseWorkflowPath, "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."); + }); +});