build-linux-arm64: switch from QEMU-emulated linux-arm64 runner to cross-compile on linux-amd64 using aarch64-linux-gnu toolchain. Removes the uname -m arch guard that was causing the job to exit immediately (QEMU reports x86_64 as kernel arch), and fixes the artifact path to the explicit target directory. All build jobs: replace `cargo install tauri-cli --locked` with `npx tauri build`, using the pre-compiled @tauri-apps/cli binary from devDependencies. Eliminates the 20-30 min Tauri CLI recompilation on every run. wiki-sync: move from test.yml to auto-tag.yml. test.yml only fires on pull_request events so the `if: github.ref == 'refs/heads/master'` guard was never true and the wiki was never updated. auto-tag.yml triggers on push to master, so wiki sync now runs on every merge. Update releaseWorkflowCrossPlatformArtifacts.test.ts to match the new workflow.
47 lines
1.9 KiB
TypeScript
47 lines
1.9 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { readFileSync } from "node:fs";
|
|
import path from "node:path";
|
|
|
|
const autoTagWorkflowPath = path.resolve(
|
|
process.cwd(),
|
|
".gitea/workflows/auto-tag.yml",
|
|
);
|
|
|
|
describe("auto-tag release cross-platform artifact handling", () => {
|
|
it("overrides OpenSSL vendoring for windows-gnu cross builds", () => {
|
|
const workflow = readFileSync(autoTagWorkflowPath, "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(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.");
|
|
expect(workflow).toContain("CI=true npx tauri build");
|
|
expect(workflow).toContain("find src-tauri/target/aarch64-unknown-linux-gnu/release/bundle -type f");
|
|
expect(workflow).toContain("CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc");
|
|
expect(workflow).toContain("PKG_CONFIG_ALLOW_CROSS: \"1\"");
|
|
expect(workflow).toContain("aarch64-unknown-linux-gnu");
|
|
});
|
|
|
|
it("fails windows uploads when no artifacts are found", () => {
|
|
const workflow = readFileSync(autoTagWorkflowPath, "utf-8");
|
|
|
|
expect(workflow).toContain(
|
|
"ERROR: No Windows amd64 artifacts were found to upload.",
|
|
);
|
|
});
|
|
|
|
it("replaces existing release assets before uploading reruns", () => {
|
|
const workflow = readFileSync(autoTagWorkflowPath, "utf-8");
|
|
|
|
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\"");
|
|
});
|
|
});
|