-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Simplify release version updates (#5724)
lib/player.js was being updated separately because: 1. Originally, we didn't have support for updating arbitrary files with release-please. 2. When we did get that support in release-please, it would trash the "-uncompiled" tag we have in uncompiled mode. By separating the uncompiled version string into two parts and using the extra-files feature of release-please, we can get the updater to preserve the "-uncompiled" tag and simplify the release workflow to only update the PR once per change instead of twice.
- Loading branch information
1 parent
a478198
commit d1d67d5
Showing
3 changed files
with
9 additions
and
28 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -23,33 +23,8 @@ jobs: | |
default-branch: ${{ github.ref_name }} | ||
# Use a special shaka-bot access token for releases. | ||
token: ${{ secrets.RELEASE_PLEASE_TOKEN }} | ||
|
||
# If we didn't create a release, we may have created or updated a PR. | ||
# Check out the code, then update the Player version in the PR. | ||
- uses: actions/checkout@v3 | ||
if: steps.release.outputs.release_created == false | ||
with: | ||
# Use a special shaka-bot access token for releases. | ||
token: ${{ secrets.RELEASE_PLEASE_TOKEN }} | ||
- name: Custom update Player version | ||
if: steps.release.outputs.release_created == false | ||
run: | | ||
# Check out the branch that release-please created. | ||
# If it does not exist, FAIL! | ||
git fetch | ||
git checkout release-please--branches--${{ github.ref_name }}--components--shaka-player || exit 1 | ||
# If it does exist, update lib/player.js in the PR branch, so that the | ||
# -uncompiled tag remains in the player version in that context. | ||
VERSION="v$(jq -r .version package.json)-uncompiled" | ||
sed -e "s/^\\(shaka.Player.version =\\).*/\\1 '$VERSION';/" \ | ||
-i lib/player.js | ||
git add lib/player.js | ||
# Set missing git config for the commit. | ||
git config user.name "shaka-bot" | ||
git config user.email "[email protected]" | ||
# Update the PR. | ||
git commit --amend --no-edit | ||
git push -f | ||
# Update these additional files containing version numbers. | ||
extra-files: lib/player.js | ||
|
||
# The jobs below are all conditional on a release having been created by | ||
# someone merging the release PR. They all run in parallel. | ||
|
This file contains 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 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