The Setup HexSign CLI action installs the hexsign binary on a runner, verifies its SHA-256 against the release's signed checksums.txt, and (when you pass a client ID and secret) flips the CLI into machine mode for the rest of the job. The next steps fetch your certificate and profile before xcodebuild, so signing material never lives in your repository.
What you need
- A service credential with
hexsign-api/readscope, created under Settings → CLI Tokens in the HexSign dashboard. The secret is shown exactly once. HEXSIGN_CLIENT_IDandHEXSIGN_CLIENT_SECRETstored as repository or environment secrets.- The certificate and profile IDs you sign with, stored as repository variables.
The release workflow
# .github/workflows/release.yml
name: Release
on:
push:
tags: ["v*"]
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Setup HexSign CLI
uses: hexsign/hexsign-cli@v1
with:
version: latest
client-id: ${{ secrets.HEXSIGN_CLIENT_ID }}
client-secret: ${{ secrets.HEXSIGN_CLIENT_SECRET }}
- name: Fetch signing material
env:
CERT_ID: ${{ vars.HEXSIGN_CERT_ID }}
PROFILE_ID: ${{ vars.HEXSIGN_PROFILE_ID }}
run: |
hexsign certificates download "$CERT_ID" --output-dir build/sign \
--keychain "$RUNNER_TEMP/signing.keychain-db"
hexsign profiles download "$PROFILE_ID" --output-dir build/sign --install
- name: Archive
run: |
xcrun xcodebuild archive \
-workspace MyApp.xcworkspace \
-scheme MyApp \
-archivePath build/MyApp.xcarchive--keychain creates a dedicated keychain, imports the .p12, and runs the set-key-partition-list authorization codesign needs, replacing the four or five security commands every CI guide used to copy-paste. --install drops the profile where Xcode finds it. If you regenerate signing material regularly, swap the IDs for --type DISTRIBUTION --team-id and --bundle-id --team-id filters and the workflow keeps working when a certificate rotates, with nothing to update.