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
This commit is contained in:
parent
4606fdd104
commit
c3fd83f330
@ -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" \
|
||||
|
||||
24
tests/unit/releaseWorkflowCrossPlatformArtifacts.test.ts
Normal file
24
tests/unit/releaseWorkflowCrossPlatformArtifacts.test.ts
Normal file
@ -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.");
|
||||
});
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user