-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (38 loc) · 1.4 KB
/
create_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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 }}