Creates a multi arch (fat) pkg MacOS installer for stackql, notarizes the package with Apple, staples the notarization ticket to the package and uploads it to the matching GitHub release.
The script is designed to run on a dedicated packaging Mac. It needs:
- Xcode command line tools (
lipo,codesign,pkgbuild,xcrun notarytool,xcrun stapler) - Apple Developer ID Application and Developer ID Installer certificates installed in the login keychain
- GitHub CLI (
gh), authenticated with an account that can read workflow artifacts and upload release assets instackql/stackql(gh auth login, the defaultrepoandworkflowscopes are sufficient) jq
Copy vars.sh.example to vars.sh and populate it. vars.sh is gitignored and holds the machine specific values: team id, Apple ID, signing identities, the login keychain password and the app specific password used for notarization.
cp vars.sh.example vars.shPass the stackql build number, this is the run number of the Build workflow in stackql/stackql and is the patch component of the version (for example build 669 is v0.11.669).
bash create-installer.sh 669The script will:
- Unlock the login keychain and store the notarization credentials as the
stackqlnotarytool profile - Look up the
Buildworkflow run for the build number and download thestackql_darwin_amd64andstackql_darwin_arm64artifacts todownloads/(gitignored) - Extract both binaries, combine them into a universal binary with
lipoand read the version fromstackql --version - Look up the GitHub release for the version, if it does not exist the script stops with
Release x.x.x does not exist, please create it first - Check whether
stackql_darwin_multiarch.pkgis already an asset of that release - Sign the binary, build the
pkg, notarize it and staple the ticket - Upload
stackql_darwin_multiarch.pkgto the release, or, if the asset already exists, leave the package indist/package/for a manual update
Outputs are written to dist/package/stackql_darwin_multiarch.pkg and dist/package/stackql_<version>_darwin_multiarch.pkg.
The following can be overridden with environment variables if needed:
| Variable | Default | Purpose |
|---|---|---|
GH_REPO |
stackql/stackql |
Repo to read artifacts from and upload the release asset to |
GH_WORKFLOW |
build.yml |
Workflow whose run number is the build number |
GH_RUN_LOOKUP_LIMIT |
500 |
How many recent workflow runs to search for the build number |