-
Notifications
You must be signed in to change notification settings - Fork 57
[Tooling] Add Buildkite release pipelines and fastlane lanes for ReleasesV2 #2583
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
Merged
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
771a952
Add lanes for CI release automation
iangmaia 489b5a5
Update helper scripts
iangmaia accbfeb
Add release pipelines
iangmaia 524a261
Add build/distribute release pipeline
iangmaia 6197af6
Update main pipeline
iangmaia 1e99f59
Improve localization automation
iangmaia 00a7fc3
Update localization documentation
iangmaia aaa9fec
Update release process documentation
iangmaia fe3188a
Add backmerge PR after .po strings bundle generation
iangmaia 35ae16e
Add `skip ci` to release process commits
iangmaia 8432951
Delete release branch once published
iangmaia 8a7814d
Add a reviewer to backmerge PRs
iangmaia d30b4d5
Tag instead of create prerelease
iangmaia e6340a1
Add buildkite annotation to backmerge prs
iangmaia 3859e0a
Fix Rubocop violations
iangmaia 80c2b68
Use `PROJECT_ROOT_FOLDER` to run external commands
iangmaia 13c04a5
Fix parameter name
iangmaia 2c6813f
Create a PR when downloading translations
iangmaia 4bdf07c
Forward GITHUB_USERNAME to the lanes
iangmaia 5bb7680
Add IMAGE_ID to release pipeline
iangmaia be073c7
Adjust paths after monorepo merge
iangmaia a5b24c1
Adjust paths in Fastlane
iangmaia 92276da
Fix monorepo path
iangmaia 531a17f
Add Studio links to build in the GitHub release
iangmaia f60b174
Create release notes draft
iangmaia 7ef21b9
Use RELEASE_VERSION also for build distribution
iangmaia 6bd284f
Simplify new beta lane
iangmaia e6681b0
Use `current_git_branch`
iangmaia 95dc04b
Fix error when downloading files
iangmaia 2ae9853
Improve log / confirmation message
iangmaia 8f63241
Add IMAGE_ID
iangmaia d4d3a39
Let the version in `distribute_release_build` to be read from package…
iangmaia 13a7182
Update release-process.md documentation
iangmaia f8732e7
Use `git checkout -B "$BRANCH_NAME" "origin/$BRANCH_NAME"` instead of…
iangmaia b008eb7
Add RELEASE-NOTES.txt validation
iangmaia bcec68a
Improve extract_release_notes regex
iangmaia 0b83471
Consolidate version bump, commit and push
iangmaia 1881972
Update release-process.md section about running lanes locally
iangmaia bd2de16
Update fastlane/Fastfile code_freeze comment
iangmaia dcb9cf8
Exclude beta tags from find_previous_tag
iangmaia cdbc5a8
Add version mismatch guard in new_beta_release
iangmaia f7708f3
Use absolute path constant for .pot file
iangmaia 93bfe7f
Add changes to replicate find_previous_tag
iangmaia b694d47
Create beta tags and GitHub releases only after the release is built
iangmaia 54b21a7
Add validation to version parameter
iangmaia 83505a2
Use latest release-toolkit to use the new `find_previous_tag`
iangmaia 14650ea
Update docs/release-process.md
iangmaia 575d06e
Update download_translations lane to download translations directly f…
iangmaia 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
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,25 @@ | ||
| #!/bin/bash -eu | ||
|
|
||
| # Script to checkout a specific release branch. | ||
| # Usage: ./checkout-release-branch.sh <RELEASE_VERSION> | ||
| # | ||
| # Buildkite, by default, checks out a specific commit, ending up in a detached HEAD state. | ||
| # But in some cases, we need to ensure to be checked out on the `release/*` branch instead, namely: | ||
| # - When a `release-pipelines/*.yml` will end up needing to do a `git push` to the `release/*` branch (for version bumps) | ||
| # - When doing a new build from a job that was `pipeline upload`'d by such a pipeline, | ||
| # to ensure that the job doing the build would include that recent extra commit before starting the build. | ||
|
|
||
| echo "--- :git: Checkout Release Branch" | ||
|
|
||
| if [[ -n "${1:-}" ]]; then | ||
| RELEASE_VERSION="$1" | ||
| elif [[ "${BUILDKITE_BRANCH:-}" =~ ^release/ ]]; then | ||
| RELEASE_VERSION="${BUILDKITE_BRANCH#release/}" | ||
| else | ||
| echo "Error: RELEASE_VERSION parameter missing and BUILDKITE_BRANCH is not a release branch" | ||
| exit 1 | ||
| fi | ||
| BRANCH_NAME="release/${RELEASE_VERSION}" | ||
|
|
||
| git fetch origin "$BRANCH_NAME" | ||
| git checkout -B "$BRANCH_NAME" "origin/$BRANCH_NAME" |
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
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,115 @@ | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json | ||
| # | ||
| # Release build and distribution pipeline. | ||
| # | ||
| # Triggered as a separate Buildkite build by the fastlane lanes (code_freeze, new_beta_release, | ||
| # finalize_release) via `buildkite_add_trigger_step` / `buildkite_trigger_build`. | ||
| # | ||
| # Expects `RELEASE_VERSION` env var to be set (e.g., '1.7.4'). | ||
| # Each step checks out the release branch to ensure it builds the latest commit. | ||
| --- | ||
|
|
||
| # Used by mac agents only | ||
| env: | ||
| IMAGE_ID: $IMAGE_ID | ||
|
|
||
| steps: | ||
| - group: 📦 Build for Mac | ||
| key: release-mac | ||
| steps: | ||
| - label: 🔨 Mac Release Build - {{matrix}} | ||
| agents: | ||
| queue: mac | ||
| command: | | ||
| .buildkite/commands/checkout-release-branch.sh "${RELEASE_VERSION}" | ||
|
|
||
| .buildkite/commands/prepare-environment.sh | ||
|
|
||
| .buildkite/commands/install-node-dependencies.sh | ||
|
|
||
| echo "--- :node: Building Binary" | ||
| npm run make:macos-{{matrix}} | ||
|
|
||
| # Local trial and error show this needs to run before the DMG generation (obviously) but after the binary has been built | ||
| echo "--- :hammer: Rebuild fs-attr if necessary before generating DMG" | ||
| case {{matrix}} in | ||
| x64) | ||
| echo "Rebuilding fs-xattr for {{matrix}} architecture" | ||
| npm rebuild fs-xattr --cpu universal | ||
| ;; | ||
| arm64) | ||
| echo "No need to rebuild fs-xattr because it works out of the box on Apple Silicon" | ||
| ;; | ||
| *) | ||
| echo "^^^ +++ Unexpected architecture {{matrix}}" | ||
| exit 1 | ||
| ;; | ||
| esac | ||
|
|
||
| echo "--- :node: Packaging in DMG" | ||
| npm run make:dmg-{{matrix}} | ||
|
|
||
| echo "--- 📃 Notarizing Binary" | ||
| bundle exec fastlane notarize_binary | ||
| plugins: [$CI_TOOLKIT_PLUGIN, $NVM_PLUGIN] | ||
| artifact_paths: | ||
| - apps/studio/out/**/*.app.zip | ||
| - apps/studio/out/*.dmg | ||
| matrix: | ||
| - x64 | ||
| - arm64 | ||
| notify: | ||
| - github_commit_status: | ||
| context: All Mac Release Builds | ||
|
|
||
| - group: 📦 Build for Windows | ||
| key: release-windows | ||
| steps: | ||
| - label: 🔨 Windows Release Build - {{matrix}} | ||
| agents: | ||
| queue: windows | ||
| command: | | ||
| bash .buildkite/commands/checkout-release-branch.sh "${RELEASE_VERSION}" | ||
| powershell -File .buildkite/commands/build-for-windows.ps1 -BuildType release -Architecture {{matrix}} | ||
| artifact_paths: | ||
| - apps\studio\out\**\studio-setup.exe | ||
| - apps\studio\out\**\studio-update.nupkg | ||
| - apps\studio\out\**\RELEASES | ||
| - apps\studio\out\**\*.appx | ||
| plugins: [$CI_TOOLKIT_PLUGIN, $NVM_PLUGIN] | ||
| matrix: | ||
| - x64 | ||
| - arm64 | ||
| notify: | ||
| - github_commit_status: | ||
| context: All Windows Release Builds | ||
|
|
||
| - label: ":rocket: Publish Release Builds" | ||
| command: | | ||
| echo "--- :robot_face: Use bot for Git operations" | ||
| source use-bot-for-git | ||
|
|
||
| .buildkite/commands/checkout-release-branch.sh "${RELEASE_VERSION}" | ||
|
|
||
| echo "--- :node: Downloading Binaries" | ||
| buildkite-agent artifact download "*.zip" . | ||
| buildkite-agent artifact download "*.dmg" . | ||
| buildkite-agent artifact download "*.exe" . | ||
| buildkite-agent artifact download "*.appx" . | ||
| buildkite-agent artifact download "*.nupkg" . | ||
| buildkite-agent artifact download "*\\RELEASES" . | ||
|
|
||
| .buildkite/commands/install-node-dependencies.sh | ||
|
|
||
| echo "--- :fastlane: Distributing Release Builds" | ||
| install_gems | ||
| bundle exec fastlane distribute_release_build | ||
| agents: | ||
| queue: mac | ||
| depends_on: | ||
| - step: release-mac | ||
| - step: release-windows | ||
| plugins: [$CI_TOOLKIT_PLUGIN, $NVM_PLUGIN] | ||
| notify: | ||
| - github_commit_status: | ||
| context: Publish Release Builds |
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,29 @@ | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json | ||
| --- | ||
|
|
||
| env: | ||
| IMAGE_ID: $IMAGE_ID | ||
|
|
||
| steps: | ||
| - label: ":snowflake: Code Freeze" | ||
| plugins: [$CI_TOOLKIT_PLUGIN, $NVM_PLUGIN] | ||
| command: | | ||
| echo "--- :robot_face: Use bot for Git operations" | ||
| source use-bot-for-git | ||
|
|
||
| echo "--- :npm: Install Node dependencies" | ||
| .buildkite/commands/install-node-dependencies.sh | ||
|
|
||
| echo "--- :ruby: Setup Ruby Tools" | ||
| install_gems | ||
|
|
||
| echo "--- :snowflake: Execute Code Freeze" | ||
| bundle exec fastlane code_freeze version:"${RELEASE_VERSION}" github_username:"${GITHUB_USERNAME}" skip_confirm:true | ||
| artifact_paths: | ||
| - i18n/bundle-strings.pot | ||
| agents: | ||
| queue: mac | ||
| retry: | ||
| manual: | ||
| reason: If release jobs fail, you should always re-trigger the task from Releases V2 rather than retrying the individual job from Buildkite | ||
| allowed: false |
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,26 @@ | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json | ||
| --- | ||
|
|
||
| env: | ||
| IMAGE_ID: $IMAGE_ID | ||
|
|
||
| steps: | ||
| - label: ":earth_asia: Download Translations" | ||
| plugins: [$CI_TOOLKIT_PLUGIN, $NVM_PLUGIN] | ||
| command: | | ||
| echo "--- :robot_face: Use bot for Git operations" | ||
| source use-bot-for-git | ||
|
|
||
| .buildkite/commands/checkout-release-branch.sh "${RELEASE_VERSION}" | ||
|
|
||
| echo "--- :ruby: Setup Ruby Tools" | ||
| install_gems | ||
|
|
||
| echo "--- :earth_asia: Download Translations" | ||
| bundle exec fastlane download_translations github_username:"${GITHUB_USERNAME}" skip_confirm:true | ||
| agents: | ||
| queue: mac | ||
| retry: | ||
| manual: | ||
| reason: If release jobs fail, you should always re-trigger the task from Releases V2 rather than retrying the individual job from Buildkite | ||
| allowed: false |
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,26 @@ | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json | ||
| --- | ||
|
|
||
| env: | ||
| IMAGE_ID: $IMAGE_ID | ||
|
|
||
| steps: | ||
| - label: ":checkered_flag: Finalize Release" | ||
| plugins: [$CI_TOOLKIT_PLUGIN, $NVM_PLUGIN] | ||
| command: | | ||
| echo "--- :robot_face: Use bot for Git operations" | ||
| source use-bot-for-git | ||
|
|
||
| .buildkite/commands/checkout-release-branch.sh "${RELEASE_VERSION}" | ||
|
|
||
| echo "--- :ruby: Setup Ruby Tools" | ||
| install_gems | ||
|
|
||
| echo "--- :checkered_flag: Finalize Release" | ||
| bundle exec fastlane finalize_release version:"${RELEASE_VERSION}" skip_confirm:true | ||
| agents: | ||
| queue: mac | ||
| retry: | ||
| manual: | ||
| reason: If release jobs fail, you should always re-trigger the task from Releases V2 rather than retrying the individual job from Buildkite | ||
| allowed: false |
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,26 @@ | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json | ||
| --- | ||
|
|
||
| env: | ||
| IMAGE_ID: $IMAGE_ID | ||
|
|
||
| steps: | ||
| - label: ":package: New Beta Release" | ||
| plugins: [$CI_TOOLKIT_PLUGIN, $NVM_PLUGIN] | ||
| command: | | ||
| echo "--- :robot_face: Use bot for Git operations" | ||
| source use-bot-for-git | ||
|
|
||
| .buildkite/commands/checkout-release-branch.sh "${RELEASE_VERSION}" | ||
|
|
||
| echo "--- :ruby: Setup Ruby Tools" | ||
| install_gems | ||
|
|
||
| echo "--- :package: Create New Beta" | ||
| bundle exec fastlane new_beta_release version:"${RELEASE_VERSION}" skip_confirm:true | ||
| agents: | ||
| queue: mac | ||
| retry: | ||
| manual: | ||
| reason: If release jobs fail, you should always re-trigger the task from Releases V2 rather than retrying the individual job from Buildkite | ||
| allowed: false |
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,24 @@ | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json | ||
| --- | ||
|
|
||
| env: | ||
| IMAGE_ID: $IMAGE_ID | ||
|
|
||
| steps: | ||
| - label: ":fire: New Hotfix Release" | ||
| plugins: [$CI_TOOLKIT_PLUGIN, $NVM_PLUGIN] | ||
| command: | | ||
| echo "--- :robot_face: Use bot for Git operations" | ||
| source use-bot-for-git | ||
|
|
||
| echo "--- :ruby: Setup Ruby Tools" | ||
| install_gems | ||
|
|
||
| echo "--- :fire: Create New Hotfix" | ||
| bundle exec fastlane new_hotfix_release version:"${RELEASE_VERSION}" skip_confirm:true | ||
| agents: | ||
| queue: mac | ||
| retry: | ||
| manual: | ||
| reason: If release jobs fail, you should always re-trigger the task from Releases V2 rather than retrying the individual job from Buildkite | ||
| allowed: false |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unclear for the rationale about removing those 2 lines, can you elaborate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, the release process was based on tags. The first line was a call to a script to check whether the current tag matches the version from the
package.json... but since we moved to a release branch based process, this doesn't make a lot of sense. The second line is just checking the exit code from the script.