-
Notifications
You must be signed in to change notification settings - Fork 92
Add tooling and CI integration to sign Mac CLI #77
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
Open
mokagio
wants to merge
14
commits into
main
Choose a base branch
from
ainfra-2466-sign-and-notarize
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
1a8e19d
Add fastlane match scaffold for code signing
mokagio a467003
Remove noisy AI comment
mokagio 8ad2f8f
Vendor gems locally and lock ruby platform
mokagio b93c694
Pin fastlane and toolkit floors to latest
mokagio 3ecf2b3
Add Buildkite sign + notarize pipeline
mokagio 5ce66ce
Derive signing image from .xcode-version
mokagio 9402efd
Pin signing image to Xcode 26.3 for nokogiri
mokagio 7e74a7a
Condense or remove AI-generated comments
mokagio 3951575
Pin ci-toolkit plugin to a commit, not a branch
mokagio fa1d766
Tighten the .xcode-version pin note
mokagio 9378429
Drop macOS build from GitHub Actions
mokagio 6135daa
Fix typo
mokagio a477420
Clarify nokogiri setup in comment
mokagio df4d3f7
Bump fastlane to latest, 2.236.0, to remove multi_json constraint
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,27 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| # We don't care about the specific Go version, only that Go is available. | ||
| # `go build` will then fetch the desired version. | ||
| if ! command -v go >/dev/null 2>&1; then | ||
| echo "--- :package: installing go" | ||
| brew install go | ||
| fi | ||
| go version | ||
|
|
||
| echo "--- :hammer_and_wrench: build macOS binaries" | ||
| GOOS=darwin GOARCH=amd64 ./build.sh -o bbctl-macos-amd64 | ||
| GOOS=darwin GOARCH=arm64 ./build.sh -o bbctl-macos-arm64 | ||
|
|
||
| echo "--- :key: fetch Developer ID cert into the agent keychain" | ||
| install_gems | ||
| bundle exec fastlane set_up_signing | ||
|
|
||
| echo "--- :apple: sign + notarize" | ||
| # sign_and_notarize comes from the CI toolkit plugin | ||
| sign_and_notarize bbctl-macos-amd64 bbctl-macos-arm64 | ||
|
|
||
| echo "--- :lock: checksums" | ||
| shasum -a 256 bbctl-macos-amd64 bbctl-macos-arm64 > sha256sums.txt | ||
| cat sha256sums.txt | ||
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,21 @@ | ||
| # 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, sign, notarize macOS binaries" | ||
| key: sign-macos | ||
| command: .buildkite/commands/sign-macos-binaries.sh | ||
| plugins: [$CI_TOOLKIT_PLUGIN] | ||
| artifact_paths: | ||
| - bbctl-macos-amd64 | ||
| - bbctl-macos-arm64 | ||
| - sha256sums.txt | ||
| notify: | ||
| - github_commit_status: | ||
| context: Sign & Notarize macOS |
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,12 @@ | ||
| #!/bin/sh | ||
|
|
||
| # Sourced before `buildkite-agent pipeline upload` so the values land in the rendered pipeline. | ||
|
|
||
| XCODE_VERSION=$(grep -Ev '^[[:space:]]*(#|$)' .xcode-version | head -n1 | sed -E 's/^[[:space:]]*//; s/^~> ?//; s/[[:space:]]*$//') | ||
| export IMAGE_ID="xcode-$XCODE_VERSION" | ||
|
|
||
| # TEMPORARY: pinned to a commit on the `mokagio/macos-sign-and-notarize` branch | ||
| # adding the macOS `sign_and_notarize` command. Revert to a released tag | ||
| # (>= the version that ships it) before merging. | ||
| CI_TOOLKIT_PLUGIN_VERSION='8a67edfc19a7fd04de7033d790bd1a7a4f0f8b4d' | ||
| export CI_TOOLKIT_PLUGIN="automattic/a8c-ci-toolkit#$CI_TOOLKIT_PLUGIN_VERSION" | ||
|
Comment on lines
+8
to
+12
|
||
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,4 @@ | ||
| --- | ||
| BUNDLE_PATH: "vendor/bundle" | ||
| BUNDLE_SPECIFIC_PLATFORM: "false" | ||
| 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 |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| /bbctl | ||
| vendor/bundle/ |
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,4 @@ | ||
| # Pinned: nokogiri 1.19.3 won't compile from source on the Xcode 26.5 image | ||
| # (its clang breaks the bundled gumbo build). 26.3 builds it. Bump once a newer | ||
| # image compiles nokogiri from source (we force the Ruby platform via .bundle/config). | ||
| 26.3 |
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,6 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| source 'https://rubygems.org' | ||
|
|
||
| gem 'fastlane', '~> 2.236' | ||
| gem 'fastlane-plugin-wpmreleasetoolkit', '~> 14.6' |
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.
Uh oh!
There was an error while loading. Please reload this page.