-
-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (55 loc) · 2.31 KB
/
release-notes.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
name: Release Notes
on:
push:
branches: [ master, release/* ]
pull_request:
branches: [ master, release/* ]
jobs:
generate-release-notes:
name: Generate Release Notes
runs-on: macos-13
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # Required for Calculate Version step (e.g. GitVersion)
# Required by GitVersion
- name: Install .NET 6.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.12.0'
- name: GitVersion Config
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
additionalArguments: '/showConfig'
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
additionalArguments: '/updateprojectfiles'
- name: Install GitReleaseManager
uses: gittools/actions/gitreleasemanager/[email protected]
with:
versionSpec: '0.13.0'
# If there are no closed issues generating the Github Release will fail because it raises an exception.
# Work around this by checking for success or no closed issue errors.
- name: Create Release ${{ steps.gitversion.outputs.majorMinorPatch }}
run: |
dotnet gitreleasemanager create --owner ${{ github.repository_owner }} --repository ${{ github.event.repository.name }} --token ${{ secrets.GITHUB_TOKEN }} --milestone v${{ steps.gitversion.outputs.majorMinorPatch }} --logFilePath output.txt || true
cat output.txt | grep 'No closed issues have been found for milestone\|Drafted release is available at'
- name: 'Generate Change Log'
run: |
dotnet-gitreleasemanager export --token ${{ secrets.GITHUB_TOKEN }} -o '${{ github.repository_owner }}' -r '${{ github.event.repository.name }}' -f 'CHANGELOG.md'
git add --renormalize CHANGELOG.md
cat CHANGELOG.md
- name: 'Commit Change Log if it Changed'
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Committing auto generated change log.
file_pattern: CHANGELOG.md