-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (52 loc) · 1.7 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Create Release
on:
workflow_dispatch:
inputs:
releaseType:
description: 'Release Type'
required: true
type: choice
options:
- default
- alpha
- beta
- rc
jobs:
bump-version:
runs-on: ubuntu-latest
name: "Bump release version and create changelog"
steps:
- name: Check out repo
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.RELEASE_ACCESS_TOKEN }}
- name: Install cz
run: pip install --user -U Commitizen
- name: Record from version
run: |
echo "FROM_VERSION=$(cz version --project)" >> $GITHUB_ENV
- name: Create release branch
run: |
git checkout -b release/next
git push -u origin release/next
# Bump version and create CHANGELOG - default release
- name: Create bump and changelog
if: ${{ inputs.releaseType == 'default' }}
run: cz bump --files-only --yes --changelog
# Bump version and create CHANGELOG - prereleasee
- name: Create bump and changelog
if: ${{ inputs.releaseType != 'default' }}
run: cz bump --files-only --yes --changelog --prerelease ${{ inputs.releaseType }}
- name: Record to version
run: |
echo "TO_VERSION=$(cz version --project)" >> $GITHUB_ENV
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.RELEASE_ACCESS_TOKEN }}
base: main
branch: release/next
delete-branch: true
title: Release ${{ env.TO_VERSION }}
body: 'Bumped ${{ env.FROM_VERSION}} -> ${{ env.TO_VERSION }}'