-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add a scheduled trunk → Play internal build #23058
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
Merged
+85
−0
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
4befabf
Add scheduled trunk → Play internal build
oguzkocer b51880a
Send trunk internal build notifications to #build-and-ship
oguzkocer 9318667
Merge branch 'trunk' into task/release-from-trunk
mokagio bd21009
Address review feedback: shebang, named lane params, env guard
oguzkocer e77cb06
Merge branch 'trunk' into task/release-from-trunk
oguzkocer 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,12 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -eu | ||
|
|
||
| echo "--- :rubygems: Setting up Gems" | ||
| install_gems | ||
|
|
||
| echo "--- :closed_lock_with_key: Installing Secrets" | ||
| bundle exec fastlane run configure_apply | ||
|
|
||
| echo "--- :hammer_and_wrench: Build WordPress & Jetpack and upload to the Play internal track" | ||
| bundle exec fastlane build_and_upload_trunk_internal skip_confirm:true skip_prechecks: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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json | ||
| --- | ||
|
|
||
| # Builds WordPress & Jetpack from `trunk` and uploads them to the Play Store `internal` testing | ||
| # track, to validate the "release from trunk" model. Runs on a schedule (configured in the | ||
| # Buildkite UI); also triggerable manually via the `PIPELINE` env var for testing. | ||
|
|
||
| agents: | ||
| queue: "android" | ||
|
|
||
| steps: | ||
| - label: ":android: Build trunk → Play internal" | ||
| command: .buildkite/commands/build-trunk-internal.sh | ||
| plugins: [$CI_TOOLKIT] | ||
| notify: | ||
| - slack: "#build-and-ship" |
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 |
|---|---|---|
|
|
@@ -111,6 +111,63 @@ | |
| create_gh_release(app: app, version_name: version_name, prerelease: true) if options[:create_release] | ||
| end | ||
|
|
||
| ##################################################################################### | ||
| # build_and_upload_trunk_internal | ||
| # ----------------------------------------------------------------------------------- | ||
| # Builds WordPress & Jetpack from the current commit and uploads them to the Play Store | ||
| # `internal` testing track. Intended to run from `trunk` (manually or on a schedule) to | ||
| # validate the "release from trunk" model. | ||
| # | ||
| # The version is computed on the fly and written to `version.properties` for the build | ||
| # only — it is NOT committed: | ||
| # - versionName: the planned release version (without the `-rc-N` suffix) | ||
| # - versionCode: via release-toolkit's `ContinuousBuildCodeFormatter`, | ||
| # i.e. `(major * 10 + minor) * 1_000_000 + BUILDKITE_BUILD_NUMBER` | ||
| # ----------------------------------------------------------------------------------- | ||
| # Usage: | ||
| # bundle exec fastlane build_and_upload_trunk_internal [skip_confirm:<true|false>] [skip_prechecks:<true|false>] | ||
| ##################################################################################### | ||
| desc 'Build WordPress & Jetpack from trunk and upload them to the Play Store internal track' | ||
| lane :build_and_upload_trunk_internal do |skip_prechecks: false, skip_confirm: false| | ||
| version_name = current_release_version | ||
|
|
||
| unless skip_prechecks | ||
| ensure_git_branch(branch: DEFAULT_BRANCH) unless is_ci | ||
|
|
||
| ensure_git_status_clean unless is_ci | ||
|
|
||
| UI.important("Building #{version_name} for upload to the Play Store internal track") | ||
|
|
||
| UI.user_error!('Aborted by user request') unless skip_confirm || UI.confirm('Do you want to continue?') | ||
|
|
||
| android_build_preflight | ||
| end | ||
|
|
||
| build_number = ENV.fetch('BUILDKITE_BUILD_NUMBER') do | ||
| UI.user_error!('BUILDKITE_BUILD_NUMBER is not set; the versionCode derives from it (Buildkite only).') | ||
| end | ||
|
|
||
| version = VERSION_FORMATTER.parse(version_name) | ||
| build_code = Fastlane::Wpmreleasetoolkit::Versioning::ContinuousBuildCodeFormatter.new.build_code( | ||
| major: version.major, | ||
| minor: version.minor, | ||
| build_number: Integer(build_number) | ||
| ) | ||
|
|
||
| UI.important("Building #{DEFAULT_BRANCH} internal build: #{version_name} (#{build_code})") | ||
|
|
||
| # Set the version for this build only. We deliberately do not commit this change. | ||
| VERSION_FILE.write_version(version_name: version_name, version_code: build_code) | ||
|
|
||
| %i[wordpress jetpack].each do |app| | ||
| build_bundle(app: app, version_name: version_name, build_code: build_code, buildType: 'Release') | ||
| upload_build_to_play_store(app: app, version_name: version_name, track: 'internal') | ||
| # `upload_gutenberg_sourcemaps` builds a file path from the app name, so it needs a String | ||
| # (a Symbol can't be passed to `File.join`). | ||
| upload_gutenberg_sourcemaps(app: app.to_s, release_version: version_name) | ||
|
Comment on lines
+165
to
+167
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Out of scope, but this sounds like something |
||
| end | ||
| end | ||
|
|
||
| ##################################################################################### | ||
| # upload_build_to_play_store | ||
| # ----------------------------------------------------------------------------------- | ||
|
|
||
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.