Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .buildkite/commands/build-sign-notarize.sh
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"

Copy link
Copy Markdown

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 bun on the Mac; because curl … | bash doesn't feel super secure (the shell script we curl and run could end up being compromised one day…)

Any other, safer alternatives?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
20 changes: 20 additions & 0 deletions .buildkite/pipeline.yml
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
11 changes: 11 additions & 0 deletions .buildkite/shared-pipeline-vars
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"
3 changes: 3 additions & 0 deletions .bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
BUNDLE_PATH: "vendor/bundle"
BUNDLE_FORCE_RUBY_PLATFORM: "true"
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ node_modules/
/beeper-desktop-cli
.upstream/
*.exe

# Ruby and fastlane
/vendor/bundle/
/fastlane/README.md
/fastlane/report.xml
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.4.9
1 change: 1 addition & 0 deletions .xcode-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
27.1
5 changes: 5 additions & 0 deletions Gemfile
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'
Loading
Loading