Skip to content

Commit 2989fb8

Browse files
authored
Add Buildkite step to optionally trigger FAD build on trunk (#16432)
2 parents 84cb276 + 66961b3 commit 2989fb8

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

.buildkite/pipeline.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,20 @@ steps:
3131
- github_commit_status:
3232
context: Prototype Build
3333

34+
- group: ":rocket: Prototype Build"
35+
if: build.branch == "trunk"
36+
steps:
37+
- input: Deploy Prototype Build?
38+
prompt: Share a Prototype Build via Firebase App Distribution?
39+
key: prototype_triggered
40+
- label: Prototype Build
41+
depends_on: prototype_triggered
42+
command: .buildkite/commands/prototype-build.sh
43+
plugins: [$CI_TOOLKIT]
44+
notify:
45+
- github_commit_status:
46+
context: Prototype Build From Trunk
47+
3448
#################
3549
# Run Unit Tests
3650
#################

fastlane/Fastfile

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ WORKSPACE_PATH = File.join(PROJECT_ROOT_FOLDER, 'WooCommerce.xcworkspace')
2929
FIREBASE_APP_ID = '1:124902176124:ios:02259de1e7c42b291620f9'
3030
FIREBASE_TESTERS_GROUP = 'woocommerce-ios---prototype-builds'
3131

32+
# Buildkite sets this env var to the PR number if on a PR, but to 'false' (and not nil) if not on a PR
33+
pull_request_number = ENV['BUILDKITE_PULL_REQUEST']&.then { |n| n == 'false' ? nil : Integer(n) }
34+
3235
BUILDKITE_RELEASE_PIPELINE = 'release-builds.yml'
3336
IOS_LOCALES = %w[ar-SA de-DE en-US es-ES fr-FR he id it ja ko nl-NL pt-BR ru sv tr zh-Hans zh-Hant].freeze
3437
SIMULATOR_VERSION = '18.5' # For screenshots
@@ -777,10 +780,10 @@ platform :ios do
777780
build_for_prototype_build
778781

779782
release_notes = <<~NOTES
780-
Pull Request: ##{pull_request_number || 'N/A'}
781783
Branch: `#{ENV.fetch('BUILDKITE_BRANCH', 'N/A')}`
782784
Commit: #{ENV.fetch('BUILDKITE_COMMIT', 'N/A')[0...7]}
783785
NOTES
786+
release_notes += "Pull Request: ##{pull_request_number}" unless pull_request_number.nil?
784787

785788
firebase_app_distribution(
786789
app: FIREBASE_APP_ID,
@@ -1526,12 +1529,6 @@ TEST_ANALYTICS_ENVIRONMENT = %w[
15261529
# Release Management Utils
15271530
# -----------------------------------------------------------------------------------
15281531

1529-
def pull_request_number
1530-
# Buildkite sets this env var to the PR number if on a PR, but to 'false' (and not nil) if not on a PR
1531-
pr_num = ENV.fetch('BUILDKITE_PULL_REQUEST', 'false')
1532-
pr_num == 'false' ? nil : Integer(pr_num)
1533-
end
1534-
15351532
def create_backmerge_pr
15361533
version = release_version_current
15371534

0 commit comments

Comments
 (0)