Skip to content

Commit c965f0a

Browse files
committed
Add GH release workflow
1 parent d71d591 commit c965f0a

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Source: https://github.com/panubo/reference-github-actions/blob/main/github-release.yml
2+
# Description: Create a GitHub release
3+
# LICENSE: MIT License, Copyright (c) 2021-2025 Volt Grid Pty Ltd t/a Panubo
4+
5+
name: GitHub Release
6+
7+
on:
8+
push:
9+
tags:
10+
- "v*"
11+
workflow_call:
12+
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
build:
18+
name: Create GitHub Release
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v5
23+
with:
24+
fetch-depth: 0 # Required for git log to work
25+
26+
- name: Get Release Notes
27+
id: get_release_notes
28+
run: |
29+
NOTES=$(git log --pretty=format:%s $(git tag --sort=-v:refname | head -1)...$(git tag --sort=-v:refname | head -2 | tail -1) | awk '{ print "-", $0 }')
30+
printf "notes<<EOF\\n%s\\nEOF\\n" "${NOTES}" >> "$GITHUB_OUTPUT"
31+
32+
- name: Create Release
33+
id: create_release
34+
uses: actions/create-release@v1
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
37+
with:
38+
tag_name: ${{ github.ref }}
39+
release_name: ${{ github.ref }}
40+
body: |
41+
Changes since last release:
42+
43+
${{ steps.get_release_notes.outputs.notes }}
44+
45+
draft: false
46+
prerelease: false

0 commit comments

Comments
 (0)