-
-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (42 loc) · 1.31 KB
/
release.yml
File metadata and controls
48 lines (42 loc) · 1.31 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
name: Release
on:
workflow_dispatch: {}
push:
branches:
- main
paths:
- CHANGELOG.md
permissions:
contents: write
id-token: write
attestations: write
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Extract version from CHANGELOG.md
id: changelog
run: |
version=$(grep -m 1 -oP '^##\s*\[\Kv[0-9]+\.[0-9]+\.[0-9]+' CHANGELOG.md)
echo "version=$version" >> $GITHUB_OUTPUT
# gh changelog new --latest
- name: "Generate Release Changelog"
run: |
gh extension install chelnak/gh-changelog
gh changelog new --next-version ${{ steps.changelog.outputs.version }} --latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# This creates a tag but doesn't trigger a "push event of the tag" FYI
- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v3
with:
token: ${{ secrets.GH_TOKEN_FOR_RELEASE_PUBLISH }}
tag_name: ${{ steps.changelog.outputs.version }}
name: ${{ steps.changelog.outputs.version }}
draft: false
prerelease: false
body_path: CHANGELOG.md