-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (50 loc) · 1.71 KB
/
cut-patch-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
55
56
57
58
name: Cut Patch Release
on:
pull_request:
types: [closed]
branches:
- main
permissions: write-all
# when a push is made to develop branch by dependabot or github-actions, or the merge branch includes 'hotfix', it will cut a patch release
jobs:
cutPatchRelease:
if: github.actor == 'dependabot[bot]' || github.actor == 'github-actions' || contains(github.event.pull_request.head.ref, 'hotfix') && github.event.pull_request.merged == true
runs-on: ubuntu-latest
name: Cut Patch Release
outputs:
v_patch: ${{ steps.semvers.outputs.v_patch }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
- name: Get previous tag
id: previoustag
uses: WyriHaximus/[email protected]
with:
prefix: "v"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Get next version
id: semvers
uses: WyriHaximus/[email protected]
with:
version: ${{ steps.previoustag.outputs.tag }}
- name: Create release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.semvers.outputs.v_patch }}
generateReleaseNotes: true
commit: "main"
- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
with:
environment: production
version: ${{ steps.semvers.outputs.v_patch }}
ignore_missing: true