Skip to content

Start Feature Release #3

Start Feature Release

Start Feature Release #3

name: Start Feature Release
env:
# This is the branch where development happens, where releases are cut from
TRUNK_BRANCH: ${{ github.event.repository.default_branch }}
on:
workflow_dispatch:
permissions:
contents: write
concurrency:
# Only run one instance of this workflow at a time
group: ${{ github.workflow }}
jobs:
rc-pr:
name: Create Release Candidate PR
runs-on: ubuntu-latest
steps:
- name: Create GitHub App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.RELEASE_BOT_APP_ID }}
private-key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ env.TRUNK_BRANCH }}
token: ${{ steps.app-token.outputs.token }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Parse version
id: version
uses: ./.github/parse-version
- name: Get branch names
id: branches
run: |
echo "rc=rc/v${{ steps.version.outputs.releaseShort }}" >> $GITHUB_OUTPUT
echo "release=release/v${{ steps.version.outputs.releaseMinor }}.x" >> $GITHUB_OUTPUT
- name: Create branches
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git branch ${{ steps.branches.outputs.release }}
git checkout -b ${{ steps.branches.outputs.rc }}
- name: Set target release version in package.json
run: |
npm version ${{ steps.version.outputs.releaseVersion }} --no-git-tag-version
git commit -am "chore: prepare for release v${{ steps.version.outputs.releaseShort }}"
- name: Set next release cycle version on ${{ env.TRUNK_BRANCH }}
run: |
git checkout ${{ env.TRUNK_BRANCH }}
npm version ${{ steps.version.outputs.nextVersion }} --no-git-tag-version
git commit -am "chore: start v${{ steps.version.outputs.nextMinor }} development interation"
- name: Push changes
run: |
git push origin ${{ env.TRUNK_BRANCH }}
git push origin ${{ steps.branches.outputs.release }}
git push origin ${{ steps.branches.outputs.rc }}
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
- name: Create Pull Request
run: |
gh pr create \
--base ${{ steps.branches.outputs.release }} \
--head ${{ steps.branches.outputs.rc }} \
--title "$PR_TITLE" \
--body "$PR_BODY"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
PR_TITLE: Release Candidate v${{ steps.version.outputs.releaseShort }}
PR_BODY: |
This PR tracks QA of the release candidate for v${{ steps.version.outputs.releaseShort }}.
:cherries: All changes to this branch should be cherry-picked from `${{ env.TRUNK_BRANCH}}`.
:warning: Only add bug fixes, copy edits and translation updates during the QA process.
:test_tube: Create a new Release Candidate build by commenting on this PR with the `/buildrc` command.
:construction: An initial Release Candidate build will be triggered shortly, and the build URL will be posted here.
:rocket: Merging this PR will trigger a release build.