-
Notifications
You must be signed in to change notification settings - Fork 2
67 lines (60 loc) · 1.94 KB
/
release.yml
File metadata and controls
67 lines (60 loc) · 1.94 KB
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
name: Release
on:
push:
tags:
- "v*.*.*"
permissions:
contents: write
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Get version from tag
id: version
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Verify manifest version matches tag
run: |
MANIFEST_VERSION=$(grep -oP '"version":\s*"\K[^"]+' custom_components/nerdqaxe/manifest.json)
TAG_VERSION=${{ steps.version.outputs.version }}
if [ "$MANIFEST_VERSION" != "$TAG_VERSION" ]; then
echo "Error: manifest.json version ($MANIFEST_VERSION) does not match tag version ($TAG_VERSION)"
exit 1
fi
- name: Generate changelog
id: changelog
uses: mikepenz/release-changelog-builder-action@v6
with:
configuration: |
{
"categories": [
{
"title": "## Features",
"labels": ["feature", "enhancement"]
},
{
"title": "## Bug Fixes",
"labels": ["fix", "bug"]
},
{
"title": "## Maintenance",
"labels": ["chore", "dependencies"]
}
],
"template": "#{{CHANGELOG}}\n\n**Full Changelog**: #{{RELEASE_DIFF}}"
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create release
uses: softprops/action-gh-release@v2
with:
name: v${{ steps.version.outputs.version }}
body: ${{ steps.changelog.outputs.changelog }}
draft: false
prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'alpha') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}