Repository navigation
Build, sign, and notarize binaries on Buildkite #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mokagio
merged 5 commits into
main
from
ainfra-3535-sign-and-notarize-beeper-cli-builds-on-buildkite
Oct 30, 2026
+622
−0
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
21542d9
Add Ruby and fastlane tooling
mokagio 0e107d2
Add fastlane lanes to sign and notarize macOS CLI
mokagio 5ce53ce
Build, sign, and notarize binaries on Buildkite
mokagio 935539d
Build on the Xcode 27.1 image
mokagio 951c837
Upload the release archives instead of a tarball
mokagio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| bun_version="$(sed -nE 's/.*"packageManager": *"bun@([^"]+)".*/\1/p' package.json)" | ||
| if [ -z "$bun_version" ]; then | ||
| echo >&2 "could not read the Bun version from package.json's packageManager" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "--- :bun: install Bun $bun_version" | ||
| curl -fsSL https://bun.sh/install | bash -s "bun-v$bun_version" | ||
| export PATH="$HOME/.bun/bin:$PATH" | ||
| bun --version | ||
|
|
||
| echo "--- :package: install dependencies" | ||
| bun install --frozen-lockfile | ||
|
|
||
| echo "--- :hammer_and_wrench: build binaries" | ||
| bun run --cwd packages/cli binary | ||
|
|
||
| bin_dir="packages/cli/dist/bin" | ||
|
|
||
| echo "--- :key: set up Ruby tooling" | ||
| install_gems | ||
|
|
||
| echo "--- :closed_lock_with_key: sign and notarize macOS binaries" | ||
| bundle exec fastlane configure_code_signing | ||
| bundle exec fastlane sign_macos_binaries | ||
|
|
||
| echo "--- :mag: check binaries.json checksums" | ||
| ruby -rjson -e ' | ||
| JSON.parse(File.read(ARGV.fetch(0))).fetch("artifacts").each do |artifact| | ||
| puts "#{artifact.fetch("sha256")} #{artifact.fetch("file")}" | ||
| end | ||
| ' "$bin_dir/binaries.json" | (cd "$bin_dir" && shasum -a 256 -c -) | ||
|
|
||
| echo "--- :package: build release archives" | ||
| # binaries.json records absolute paths on this agent, so the archives must be built here. | ||
| bun run --cwd packages/cli scripts/build-homebrew-archive.ts | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json | ||
| --- | ||
|
|
||
| agents: | ||
| queue: mac | ||
|
|
||
| env: | ||
| IMAGE_ID: $IMAGE_ID | ||
|
|
||
| steps: | ||
| - label: ":apple: Build binaries, sign and notarize macOS" | ||
| key: build-sign-notarize | ||
| command: .buildkite/commands/build-sign-notarize.sh | ||
| plugins: [$CI_TOOLKIT_PLUGIN] | ||
| artifact_paths: | ||
| - packages/cli/dist/bin/binaries.json | ||
| - packages/cli/dist/release/* | ||
| notify: | ||
| - github_commit_status: | ||
| context: Build, Sign & Notarize |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| #!/bin/sh | ||
|
|
||
| # Sourced before `buildkite-agent pipeline upload` so the values land in the | ||
| # rendered pipeline, keeping plugin pins and the agent image id out of pipeline.yml. | ||
|
|
||
| CI_TOOLKIT_PLUGIN_VERSION='7.1.0' | ||
|
|
||
| XCODE_VERSION=$(sed -E 's/^~> ?//' .xcode-version) | ||
|
|
||
| export IMAGE_ID="xcode-$XCODE_VERSION" | ||
| export CI_TOOLKIT_PLUGIN="automattic/a8c-ci-toolkit#$CI_TOOLKIT_PLUGIN_VERSION" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| --- | ||
| BUNDLE_PATH: "vendor/bundle" | ||
| BUNDLE_FORCE_RUBY_PLATFORM: "true" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 3.4.9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 27.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| source 'https://rubygems.org' | ||
|
|
||
| gem 'fastlane', '~> 2.241' |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish there were a safer way to install a specific version of
bunon the Mac; becausecurl … | bashdoesn't feel super secure (the shell script we curl and run could end up being compromised one day…)Any other, safer alternatives?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! Tracked in https://linear.app/a8c/issue/AINFRA-3562