-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
38 lines (34 loc) · 1.1 KB
/
auto-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
name: Gitflow - Auto prepare release
on:
pull_request:
types:
- closed
branches:
- master
# This workflow tirggers a release when merging a branch with the pattern `prepare-release/VERSION` into master.
jobs:
release:
runs-on: ubuntu-20.04
name: 'Prepare a new version'
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_RELEASE_PAT }}
fetch-depth: 0
# https://github.com/actions-ecosystem/action-regex-match
- uses: actions-ecosystem/action-regex-match@v2
id: version
with:
# Parse version from head branch
text: ${{ github.head_ref }}
# match: preprare-release/xx.xx.xx
regex: '^prepare-release\/(\d+\.\d+\.\d+)$'
- name: Prepare release
uses: getsentry/action-prepare-release@v1
if: github.event.pull_request.merged == true && steps.version.outputs.match != ''
env:
GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }}
with:
version: ${{ steps.version.outputs.group1 }}
force: false
merge_target: master