Create Release Branch #14
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
name: Create Release Branch | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
type: choice | |
description: Sematic version type of new version | |
options: | |
- patch | |
- minor | |
- major | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: develop | |
- name: Git configuration | |
run: | | |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
git config --global user.name "${GITHUB_ACTOR}" | |
- name: Upgrade version | |
run: | | |
yarn --no-git-tag-version version --$RELEASE_TYPE | |
echo "NEW_VERSION=$(npm pkg get version | tr -d '"')" >> $GITHUB_ENV | |
env: | |
RELEASE_TYPE: ${{ github.event.inputs.version }} | |
- name: Create release branch | |
run: | | |
git checkout -b release/${{ env.NEW_VERSION }} | |
git add "package.json" | |
git commit -m "Upgrade version to ${{ env.NEW_VERSION }}" | |
git push origin release/${{ env.NEW_VERSION }} | |
gh pr create -B main -H release/${{ env.NEW_VERSION }} -d --title 'Upgrade version to ${{ env.NEW_VERSION }}' --body 'Upgrade version to ${{ env.NEW_VERSION }}' | |
gh pr create -B develop -H release/${{ env.NEW_VERSION }} -d --title 'Release/${{ env.NEW_VERSION }} -> develop' --body 'Upgrade version to ${{ env.NEW_VERSION }}' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |