Windows: a hand-written NSIS script (per user, no administrator prompt, installs under the profile's Programs folder; one program file; a Start Menu entry named Wanderbooks with the icon; an uninstaller listed in Settings > Apps that removes only what the installer put in its own folder and never names the data folder). The installer asks the person to quit the app fully before it replaces or removes the program. An optional Authenticode signing step runs only when its secrets exist. macOS: the .app is assembled by a script (Info.plist with the bundle identifier, version, name, Documents-folder purpose string; the one program at Contents/MacOS/wanderbooks; the licences), signed with the hardened runtime and an empty entitlements file that says why, put in a dmg with an Applications shortcut, notarized and stapled when the owner's Apple identity is given and skipped with a notice when not. The program is one universal binary (lipo of the two release builds). Linux: both desktop entries name the window's app id and the icon; the rpm now installs the icon; the deb, the pacman tarball and the rpm all carry LICENSE-MIT and LICENSE-APACHE beside the notices. One version: deploy/packaging/version.sh reads crates/ledger-cli's Cargo.toml; every script takes it from there. Tests read the scripts and build a bundle with a stand-in program. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
25 lines
1.3 KiB
Bash
Executable File
25 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Put the owner's Developer ID certificate into a temporary keychain on a CI
|
|
# macOS runner, so `codesign` can use it (plan P15 unit C1). Run by the
|
|
# release workflow only when the secrets exist. Takes the certificate (a .p12,
|
|
# base64) and its password from the environment, never the command line:
|
|
# APPLE_CERTIFICATE_P12_BASE64, APPLE_CERTIFICATE_PASSWORD
|
|
# Prints no secret. The keychain lives in RUNNER_TEMP and goes with the
|
|
# runner.
|
|
set -euo pipefail
|
|
: "${APPLE_CERTIFICATE_P12_BASE64:?the certificate secret is empty}"
|
|
: "${APPLE_CERTIFICATE_PASSWORD:?the certificate password secret is empty}"
|
|
: "${RUNNER_TEMP:?not on a GitHub runner}"
|
|
keychain="$RUNNER_TEMP/wanderbooks-signing.keychain-db"
|
|
password=$(uuidgen)
|
|
p12="$RUNNER_TEMP/wanderbooks-signing.p12"
|
|
printf '%s' "$APPLE_CERTIFICATE_P12_BASE64" | base64 --decode > "$p12"
|
|
security create-keychain -p "$password" "$keychain"
|
|
security set-keychain-settings -lut 21600 "$keychain"
|
|
security unlock-keychain -p "$password" "$keychain"
|
|
security import "$p12" -k "$keychain" -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign
|
|
security set-key-partition-list -S apple-tool:,apple: -s -k "$password" "$keychain" >/dev/null
|
|
security list-keychains -d user -s "$keychain" login.keychain
|
|
rm -f "$p12"
|
|
security find-identity -v -p codesigning "$keychain"
|