Skip to content

Create Release Branch #27

Create Release Branch

Create Release Branch #27

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/v${{ env.NEW_VERSION }}
git add "package.json"
git commit -m "Upgrade version to ${{ env.NEW_VERSION }}"
git push origin release/v${{ env.NEW_VERSION }}
gh pr create -B master -H release/v${{ 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/v${{ env.NEW_VERSION }} -d --title 'Release/v${{ env.NEW_VERSION }} -> develop' --body 'Upgrade version to ${{ env.NEW_VERSION }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}