Skip to content

Commit b7a8374

Browse files
authored
Add a promote-to-production flow (beta → production) to the Play Store (#23104)
* Add a promote-to-production flow (beta → production) to the Play Store Adds the gather_production_candidate and promote_to_production lanes, the promote-production.yml pipeline, and its command scripts. Promotes the current beta build to the production track as a draft via the Play API for WordPress and Jetpack, gated by a Buildkite confirmation block step. Shared beta-promotion helpers and constants are renamed for track parity. * Use modifier unless in common_track_version_code (Style/IfUnlessModifier)
1 parent a98d01d commit b7a8374

4 files changed

Lines changed: 351 additions & 35 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
set -eu
4+
5+
# Determines the current beta build, opens the "confirm the release" block step, and posts to
6+
# Slack. No build — just gems + secrets.
7+
8+
echo "--- :rubygems: Setting up Gems"
9+
install_gems
10+
11+
echo "--- :closed_lock_with_key: Installing Secrets"
12+
bundle exec fastlane run configure_apply
13+
14+
echo "--- :android: Gathering the production candidate and opening the block step"
15+
bundle exec fastlane gather_production_candidate
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env bash
2+
3+
set -eu
4+
5+
# Releases the build gathered by the preceding step to the production track, once a developer has
6+
# confirmed the block step. The version code is passed as the first argument; the Yes/No
7+
# confirmation is read from Buildkite meta-data. No build — just gems + secrets.
8+
9+
VERSION_CODE="${1:-}"
10+
11+
# `production_ready_to_release` must stay in sync with PRODUCTION_CONFIRM_META_DATA_KEY in
12+
# fastlane/lanes/promote.rb, which is the key the block-step confirmation field writes.
13+
READY="$(buildkite-agent meta-data get "production_ready_to_release" --default "no")"
14+
15+
if [[ "${READY}" != "yes" ]]; then
16+
echo "--- :no_entry_sign: Release not confirmed (production_ready_to_release=${READY}); skipping."
17+
exit 0
18+
fi
19+
20+
if [[ -z "${VERSION_CODE}" ]]; then
21+
echo "+++ :x: No version code was provided to release."
22+
exit 1
23+
fi
24+
25+
echo "--- :rubygems: Setting up Gems"
26+
install_gems
27+
28+
echo "--- :closed_lock_with_key: Installing Secrets"
29+
bundle exec fastlane run configure_apply
30+
31+
echo "--- :rocket: Releasing ${VERSION_CODE} to the production track"
32+
bundle exec fastlane promote_to_production version_code:"${VERSION_CODE}"

.buildkite/promote-production.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json
2+
---
3+
4+
# Production release — run manually via the `PIPELINE` env var. Determines the current beta build,
5+
# opens a block step to confirm the release, and releases it to the production track.
6+
7+
agents:
8+
queue: "android"
9+
10+
steps:
11+
- label: ":android: Gather build to release to production"
12+
command: ".buildkite/commands/gather-production-candidate.sh"
13+
plugins: [$CI_TOOLKIT]
14+
15+
# Slack backstop for any failed build — its unique value is failures that abort before the lane runs
16+
# (gems/secrets) and can't self-report; on a lane failure it may also accompany the lane's own
17+
# message. Channel intentionally stays the test channel for now (see send_slack_message).
18+
notify:
19+
- slack: "#test-wpmobile-slack-integration"
20+
if: build.state == "failed"

0 commit comments

Comments
 (0)