fix(ci): run linux arm release natively and enforce arm artifacts
Avoid cross-compiling GTK/glib on the arm release job by building natively on ARM64 hosts, add an explicit architecture guard, and restrict uploads to arm64/aarch64 artifact filenames so amd64 outputs cannot be published as arm releases. Made-with: Cursor
This commit is contained in:
parent
aaa48d65a2
commit
7b5f2daaa4
@ -348,10 +348,14 @@ jobs:
|
||||
apt-get install -y nodejs
|
||||
- name: Build
|
||||
run: |
|
||||
ARCH=$(uname -m)
|
||||
if [ "$ARCH" != "aarch64" ] && [ "$ARCH" != "arm64" ]; then
|
||||
echo "ERROR: linux-arm64 job is not running on an ARM64 host (uname -m=$ARCH)."
|
||||
exit 1
|
||||
fi
|
||||
npm ci --legacy-peer-deps
|
||||
rustup target add aarch64-unknown-linux-gnu
|
||||
cargo install tauri-cli --version "^2" --locked
|
||||
CI=true cargo tauri build --target aarch64-unknown-linux-gnu
|
||||
CI=true cargo tauri build
|
||||
- name: Upload artifacts
|
||||
env:
|
||||
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
@ -378,10 +382,10 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
echo "Release ID: $RELEASE_ID"
|
||||
ARTIFACTS=$(find src-tauri/target/aarch64-unknown-linux-gnu/release/bundle -type f \
|
||||
\( -name "*.deb" -o -name "*.rpm" -o -name "*.AppImage" \))
|
||||
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" \))
|
||||
if [ -z "$ARTIFACTS" ]; then
|
||||
echo "ERROR: No Linux arm64 artifacts were found to upload."
|
||||
echo "ERROR: No Linux arm64 artifacts were found to upload (arm64/aarch64 filename filter)."
|
||||
exit 1
|
||||
fi
|
||||
printf '%s\n' "$ARTIFACTS" | while IFS= read -r f; do
|
||||
|
||||
@ -19,11 +19,14 @@ 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.");
|
||||
expect(workflow).toContain("cargo tauri build --target aarch64-unknown-linux-gnu");
|
||||
expect(workflow).toContain(
|
||||
"find src-tauri/target/aarch64-unknown-linux-gnu/release/bundle -type f",
|
||||
"ERROR: No Linux arm64 artifacts were found to upload (arm64/aarch64 filename filter).",
|
||||
);
|
||||
expect(workflow).toContain(
|
||||
"ERROR: linux-arm64 job is not running on an ARM64 host (uname -m=$ARCH).",
|
||||
);
|
||||
expect(workflow).toContain("CI=true cargo tauri build");
|
||||
expect(workflow).toContain("find src-tauri/target/release/bundle -type f");
|
||||
});
|
||||
|
||||
it("fails windows uploads when no artifacts are found", () => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user