Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/workflows/desktop-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,19 @@ jobs:

- name: Verify native macOS icon bundling
if: runner.os == 'macOS'
shell: bash
env:
OPENBITFUN_TEST_MACOS_BUNDLE: '1'
run: node --test scripts/macos-icon-bundle.test.mjs
WORKFLOW_SHA: ${{ github.workflow_sha }}
run: |
set -euo pipefail
# Load the verification policy from this workflow. Its relative imports,
# fixtures and installed CLIs still resolve in the release checkout.
probe="scripts/.macos-icon-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}.test.mjs"
trap 'rm -f "$probe"' EXIT
git fetch --no-tags --depth=1 origin "$WORKFLOW_SHA"
git show "${WORKFLOW_SHA}:scripts/macos-icon-bundle.test.mjs" > "$probe"
node --test "$probe"

- name: Build desktop app
run: ${{ matrix.platform.build_command }}
Expand Down
6 changes: 5 additions & 1 deletion scripts/macos-icon-bundle.test.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import assert from 'node:assert/strict';
import { execFileSync } from 'node:child_process';
import { copyFileSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from 'node:fs';
import { createRequire } from 'node:module';
import { tmpdir } from 'node:os';
import { dirname, join, resolve } from 'node:path';
import test from 'node:test';
Expand Down Expand Up @@ -69,7 +70,10 @@ test('Windows autocrlf checkout preserves the committed macOS icon source digest

test('CLI is locked and macOS overlays preserve the same dev/legacy icon', () => {
for (const packagePath of ['package.json', 'OpenBitFun-Installer/package.json']) {
assert.equal(json(join(ROOT, packagePath)).devDependencies['@tauri-apps/cli'], '2.11.4');
const manifest = join(ROOT, packagePath);
const installed = createRequire(manifest)('@tauri-apps/cli/package.json').version;
assert.equal(json(manifest).devDependencies['@tauri-apps/cli'], installed,
`${packagePath} must pin the exact Tauri CLI used by its build`);
}
for (const app of ['src/apps/desktop', 'OpenBitFun-Installer/src-tauri']) {
const directory = join(ROOT, app);
Expand Down
Loading