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
5 changes: 1 addition & 4 deletions .buildkite/commands/build-and-upload-testflight.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#!/bin/bash -eu

# Builds one app and uploads it to TestFlight for internal testers.
#
# Part of the "Faster Releases for WordPress and Jetpack" RFC. CI runs one
# invocation per app (in parallel) via the matrix step in pipeline.yml.

APP="${1:?Usage: build-and-upload-testflight.sh <wordpress|jetpack|reader>}"

Expand All @@ -13,5 +10,5 @@ APP="${1:?Usage: build-and-upload-testflight.sh <wordpress|jetpack|reader>}"
echo "--- :closed_lock_with_key: Installing Secrets"
bundle exec fastlane run configure_apply

echo "--- :hammer_and_wrench: Building and uploading ${APP} to TestFlight"
echo "--- :testflight: Building and uploading ${APP} to TestFlight"
bundle exec fastlane build_and_upload_app_for_testflight app:"${APP}"
6 changes: 1 addition & 5 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@ steps:
context: "Jetpack Prototype Build"

#################
# Continuous Delivery: build & upload each app to TestFlight (internal testers)
#
# Part of the "Faster Releases for WordPress and Jetpack" RFC. On every trunk
# commit, each app builds and uploads to TestFlight in parallel via the matrix
# below. Gated to trunk so it doesn't run on PR branches.
# Continuous Delivery: build & upload each app to TestFlight (internal testers) from trunk
#################
- group: ":testflight: TestFlight Builds"
key: testflight_builds_group
Expand Down
33 changes: 12 additions & 21 deletions fastlane/lanes/build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -317,28 +317,22 @@
# Builds a single app and uploads it to TestFlight for *internal* testers,
# stamping the build code with the Buildkite build number.
#
# This is the per-commit "continuous delivery" build from the "Faster Releases
# for WordPress and Jetpack" RFC. It is intentionally additive: the existing
# release lanes are untouched and remain the source of truth until this flow
# is proven.
#
# The marketing version (`VERSION_SHORT`) is read from `Version.public.xcconfig`
# as-is. The build code is `<marketing version>.0.<buildkite build number>`
# (e.g. `27.0.0.4567`). Buildkite build numbers increase monotonically, so each
# build for a given marketing version gets a unique, higher build code β€” which
# is all App Store Connect requires.
#
# "Internal-only" means no external groups and no external-tester notifications
# (matching the existing Reader upload). Distributing to the a8c staff beta
# group, and separately to the public beta group, is wired up in later phases
# of the RFC.
#
# @param [String] app One of `wordpress`, `jetpack`, or `reader`.
#
# @called_by CI
#
desc 'Builds one app and uploads it to TestFlight for internal testers'
lane :build_and_upload_app_for_testflight do |app:|
# Fail before any cert/profile work if the build code can't be computed.
build_number = ENV.fetch('BUILDKITE_BUILD_NUMBER', nil)
UI.user_error!('BUILDKITE_BUILD_NUMBER is not set β€” this lane is meant to run on CI') if build_number.nil?

app = app.to_s.downcase

case app
Expand Down Expand Up @@ -367,9 +361,6 @@
UI.user_error!("Unknown app '#{app}'. Expected one of: wordpress, jetpack, reader")
end

build_number = ENV.fetch('BUILDKITE_BUILD_NUMBER', nil)
UI.user_error!('BUILDKITE_BUILD_NUMBER is not set β€” this lane is meant to run on CI') if build_number.nil?

build_code = "#{release_version_current}.0.#{build_number}"
UI.important("Building #{scheme} #{release_version_current} (#{build_code}) for internal TestFlight distribution")

Expand Down Expand Up @@ -419,7 +410,9 @@
#
desc 'Builds and uploads WordPress and Jetpack to TestFlight (internal)'
lane :build_all_apps_for_testflight do
%w[wordpress jetpack].each do |app|
apps = %w[wordpress jetpack]
UI.important("Building #{apps.join(' and ')} for TestFlight. Reader is omitted because its App Store archive is currently broken.")
apps.each do |app|
build_and_upload_app_for_testflight(app: app)
end
end
Expand Down Expand Up @@ -542,24 +535,22 @@ def upload_build_to_testflight(ipa_path:, whats_new_path:, distribution_groups:,
# @param [String] beta_app_description_path Path to the beta app description file.
#
def upload_app_to_testflight_internal(ipa_path:, beta_app_description_path:)
# TBD (RFC D4): the "what's new" text for per-commit internal builds is not
# TODO: the "what's new" text for per-commit internal builds is not
# finalized yet. For now, generate a minimal placeholder from the commit
# metadata so the upload has something to show. Public-beta builds will get
# richer notes generated from the PRs merged since the previous public build.
changelog = "Automated build from `#{ENV.fetch('BUILDKITE_BRANCH', 'unknown')}` (#{ENV.fetch('BUILDKITE_COMMIT', 'unknown')[0...7]})."
whats_new_path = File.join(Dir.tmpdir, 'testflight_whats_new.txt')
changelog = "Automated build from `#{ENV.fetch('BUILDKITE_BRANCH', 'unknown branch')}` (#{ENV.fetch('BUILDKITE_COMMIT', 'unknown commit')[0...7]})."

begin
Dir.mktmpdir do |dir|
whats_new_path = File.join(dir, 'testflight_whats_new.txt')
File.write(whats_new_path, changelog)

upload_build_to_testflight(
ipa_path: ipa_path,
whats_new_path: whats_new_path,
distribution_groups: [], # Internal-only for now (RFC D2): no external groups.
distribution_groups: [],
beta_app_description_path: beta_app_description_path
)
ensure
FileUtils.rm_rf(whats_new_path)
end
end

Expand Down