-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (78 loc) · 2.55 KB
/
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Release
on:
push:
tags: "*"
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
getVersion:
runs-on: ubuntu-latest
outputs:
currentVersion: ${{ steps.currentVersion.outputs.currentVersion }}
nextVersion: ${{ steps.nextVersion.outputs.nextVersion }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure committer
run: |
git config user.name "HRA Digital"
git config user.email "[email protected]"
- name: Get Next Version
id: semver
uses: ietf-tools/semver-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref_name }}
majorList: break
patchAll: true
- name: Current version
id: currentVersion
run: echo "::set-output name=currentVersion::$current"
- name: Next version
id: nextVersion
run: echo "::set-output name=nextVersion::$nextStrict"
generateChangeLog:
runs-on: ubuntu-latest
needs: getVersion
outputs:
currentVersion: ${{ needs.getVersion.outputs.currentVersion }}
nextVersion: ${{ needs.getVersion.outputs.nextVersion }}
changeLogText: ${{ steps.changelog.outputs.changelog }}
steps:
- name: Checkout
uses: actions/checkout@v2
- run: echo Previous - ${{ needs.getVersion.outputs.currentVersion }}
- run: echo Current - ${{ needs.getVersion.outputs.nextVersion }}
- name: Generate CHANGELOG
id: changelog
uses: heinrichreimer/[email protected]
with:
token: ${{ github.token }}
sinceTag: ${{ needs.getVersion.outputs.currentVersion }}
excludeTags:
compareLink: true
breakingLabel: Breaking changes
breakingLabels: break, breaking, breaking changes
headerLabel: Release
dorelease:
runs-on: ubuntu-latest
needs: generateChangeLog
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure committer
run: |
git config user.name "HRA Digital"
git config user.email "[email protected]"
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.generateChangeLog.outputs.nextVersion }}
release_name: v${{ needs.generateChangeLog.outputs.nextVersion }}
body: ${{ needs.generateChangeLog.outputs.changeLogText }}
draft: false
prerelease: false