fix: resolve macOS bundle path after app rename
Find the generated .app bundle dynamically in release CI so macOS packaging no longer depends on the legacy TFTSR.app name. Add a unit test to prevent regressions by asserting the old hardcoded path is not reintroduced. Made-with: Cursor
This commit is contained in:
parent
64492c743b
commit
b426f56149
@ -130,13 +130,18 @@ jobs:
|
||||
cargo install tauri-cli --version "^2" --locked
|
||||
# Build the .app bundle only (no DMG yet so we can sign before packaging)
|
||||
CI=true cargo tauri build --target aarch64-apple-darwin --bundles app
|
||||
APP=src-tauri/target/aarch64-apple-darwin/release/bundle/macos/TFTSR.app
|
||||
APP=$(find src-tauri/target/aarch64-apple-darwin/release/bundle/macos -maxdepth 1 -type d -name "*.app" | head -n 1)
|
||||
if [ -z "$APP" ]; then
|
||||
echo "ERROR: Could not find macOS app bundle"
|
||||
exit 1
|
||||
fi
|
||||
APP_NAME=$(basename "$APP" .app)
|
||||
# Ad-hoc sign: changes Gatekeeper error from "damaged" to "unidentified developer"
|
||||
codesign --deep --force --sign - "$APP"
|
||||
# Create DMG from the signed .app
|
||||
mkdir -p src-tauri/target/aarch64-apple-darwin/release/bundle/dmg
|
||||
DMG=src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/TFTSR.dmg
|
||||
hdiutil create -volname "TFTSR" -srcfolder "$APP" -ov -format UDZO "$DMG"
|
||||
DMG=src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/${APP_NAME}.dmg
|
||||
hdiutil create -volname "$APP_NAME" -srcfolder "$APP" -ov -format UDZO "$DMG"
|
||||
- name: Upload artifacts
|
||||
env:
|
||||
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
||||
|
||||
23
tests/unit/releaseWorkflowMacBundle.test.ts
Normal file
23
tests/unit/releaseWorkflowMacBundle.test.ts
Normal file
@ -0,0 +1,23 @@
|
||||
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 macOS bundle path", () => {
|
||||
it("does not reference the legacy TFTSR.app bundle name", () => {
|
||||
const workflow = readFileSync(releaseWorkflowPath, "utf-8");
|
||||
|
||||
expect(workflow).not.toContain("/bundle/macos/TFTSR.app");
|
||||
});
|
||||
|
||||
it("resolves the macOS .app bundle dynamically", () => {
|
||||
const workflow = readFileSync(releaseWorkflowPath, "utf-8");
|
||||
|
||||
expect(workflow).toContain("APP=$(find");
|
||||
expect(workflow).toContain("-name \"*.app\"");
|
||||
});
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user