-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (46 loc) · 1.49 KB
/
publish_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
name: Publish release to GitHub
on:
push:
branches:
- main
concurrency:
group: publish
jobs:
check_for_release:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.release_version.outputs.version }}
exists: ${{ steps.version_tag.outputs.exists }}
steps:
- uses: actions/checkout@v4
- name: Get release version
id: release_version
run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT
- name: Check if version tag already exists
id: version_tag
uses: mukunku/tag-exists-action@bdad1eaa119ce71b150b952c97351c75025c06a9
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: v${{ steps.release_version.outputs.version }}
release:
if: ${{ needs.check_for_release.outputs.exists == 'false' }}
needs: [check_for_release]
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
validation_level: warn
version: ${{ needs.check_for_release.outputs.version }}
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ needs.check_for_release.outputs.version }}
name: Release v${{ needs.check_for_release.outputs.version }}
body: ${{ steps.changelog_reader.outputs.changes }}