-
-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (45 loc) · 1.59 KB
/
release.yml
File metadata and controls
55 lines (45 loc) · 1.59 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
name: Release
on:
workflow_dispatch: {}
permissions:
contents: write
id-token: write
attestations: write
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
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
# - name: Create and push git tag
# run: |
# version=${{ steps.changelog.outputs.version }}
# git config user.name "github-actions[bot]"
# git config user.email "github-actions[bot]@users.noreply.github.com"
# git tag "v$version"
# git push origin "v$version"
# 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: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.changelog.outputs.version }}
release_name: Release ${{ steps.changelog.outputs.version }}
draft: false
prerelease: false
body_path: CHANGELOG.md