Skip to content

Commit d2dba08

Browse files
committed
✨ feat: add GitHub Actions workflow for automated release process
1 parent 199a04b commit d2dba08

2 files changed

Lines changed: 83 additions & 5 deletions

File tree

.github/workflows/release.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
- "[0-9]+.[0-9]+.[0-9]+"
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
release:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Extract version from tag
22+
id: version
23+
run: |
24+
TAG=${GITHUB_REF#refs/tags/}
25+
# Remove 'v' prefix if present
26+
VERSION=${TAG#v}
27+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
28+
echo "tag=${TAG}" >> $GITHUB_OUTPUT
29+
30+
- name: Extract changelog for version
31+
id: changelog
32+
run: |
33+
VERSION="${{ steps.version.outputs.version }}"
34+
35+
# Extract changelog section for this version
36+
CHANGELOG=$(awk -v version="$VERSION" '
37+
BEGIN { found=0; capture=0; content="" }
38+
/^### \[/ {
39+
if (capture) { exit }
40+
if ($0 ~ "\\[" version "\\]") {
41+
found=1
42+
capture=1
43+
next
44+
}
45+
}
46+
capture && /^### \[/ { exit }
47+
capture {
48+
if (content != "") content = content "\n"
49+
content = content $0
50+
}
51+
END {
52+
if (found) print content
53+
else print "Release " version
54+
}
55+
' CHANGELOG.md)
56+
57+
# Save to file for multiline output
58+
echo "$CHANGELOG" > /tmp/changelog.txt
59+
60+
# Set output using file
61+
{
62+
echo "content<<EOF"
63+
cat /tmp/changelog.txt
64+
echo "EOF"
65+
} >> $GITHUB_OUTPUT
66+
67+
- name: Create GitHub Release
68+
uses: softprops/action-gh-release@v1
69+
with:
70+
name: Release ${{ steps.version.outputs.version }}
71+
body: ${{ steps.changelog.outputs.content }}
72+
draft: false
73+
prerelease: ${{ contains(steps.version.outputs.version, 'alpha') || contains(steps.version.outputs.version, 'beta') || contains(steps.version.outputs.version, 'rc') }}
74+
generate_release_notes: false
75+
env:
76+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ All notable changes to this project will be documented in this file.
66

77
## UNRELEASED
88

9-
### Added
9+
## Latest Release
10+
11+
### [0.3.0] - 2025-06-10
12+
13+
#### Added
1014

1115
- feat: add verbose output support for watch task with `-v` flag
1216
- Shows informative messages during watch mode based on verbosity level
@@ -30,20 +34,18 @@ All notable changes to this project will be documented in this file.
3034
- feat: add command alias `frontend:clean` for quick access
3135
- feat: add CI/CD tests for static:clean command in compatibility workflow
3236

33-
### Fixed
37+
#### Fixed
3438

3539
- fix: remove duplicate `--verbose` option from WatchCommand that conflicted with Symfony Console's built-in verbose option
3640

37-
### Changed
41+
#### Changed
3842

3943
- refactor: improve build commands to show full output in verbose mode
4044
- Remove `--quiet` flag from npm/grunt build commands when using verbose mode
4145
- Allow better debugging of build issues during theme compilation
4246
- refactor: split complex executeCommand method into smaller, focused methods to reduce cyclomatic complexity
4347
- docs: update copilot-instructions.md with CI/CD integration guidelines for new commands
4448

45-
## Latest Release
46-
4749
### [0.2.2] - 2025-06-05
4850

4951
- feat: enhance theme command arguments for better clarity and compatibility

0 commit comments

Comments
 (0)