Skip to content

Commit de1fcb7

Browse files
committed
Add GitHub Actions workflow for automated release creation with changelog generation
1 parent c497f50 commit de1fcb7

1 file changed

Lines changed: 69 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
jobs:
9+
create-release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Get version from tag
21+
id: get_version
22+
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
23+
24+
- name: Get previous tag
25+
id: get_previous_tag
26+
run: |
27+
PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
28+
echo "PREVIOUS_TAG=$PREVIOUS_TAG" >> $GITHUB_OUTPUT
29+
30+
- name: Generate changelog
31+
id: changelog
32+
run: |
33+
if [ -n "${{ steps.get_previous_tag.outputs.PREVIOUS_TAG }}" ]; then
34+
CHANGELOG=$(git log ${{ steps.get_previous_tag.outputs.PREVIOUS_TAG }}..HEAD --pretty=format:"- %s (%h)" --no-merges)
35+
else
36+
CHANGELOG="Initial release"
37+
fi
38+
echo "CHANGELOG<<EOF" >> $GITHUB_OUTPUT
39+
echo "$CHANGELOG" >> $GITHUB_OUTPUT
40+
echo "EOF" >> $GITHUB_OUTPUT
41+
42+
- name: Create Release
43+
uses: softprops/action-gh-release@v1
44+
with:
45+
tag_name: ${{ steps.get_version.outputs.VERSION }}
46+
name: ${{ steps.get_version.outputs.VERSION }}
47+
body: |
48+
## eGPU Auto-Enable ${{ steps.get_version.outputs.VERSION }}
49+
50+
### Installation
51+
```powershell
52+
# Run as Administrator
53+
irm https://raw.githubusercontent.com/Bananz0/eGPUae/main/Install-eGPU-Startup.ps1 | iex
54+
```
55+
56+
### What's Changed
57+
${{ steps.changelog.outputs.CHANGELOG }}
58+
59+
### Requirements
60+
- Windows 10/11
61+
- PowerShell 7.0+
62+
- Administrator privileges
63+
64+
**Full Changelog**: https://github.com/Bananz0/eGPUae/compare/${{ steps.get_previous_tag.outputs.PREVIOUS_TAG }}...${{ steps.get_version.outputs.VERSION }}
65+
draft: false
66+
prerelease: false
67+
generate_release_notes: true
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)