63 lines
1.8 KiB
YAML
63 lines
1.8 KiB
YAML
name: Create Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Extract version from tag
|
|
id: version
|
|
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Extract changelog for this version
|
|
id: changelog
|
|
run: |
|
|
# Extract the changelog section for this version
|
|
VERSION="${{ steps.version.outputs.VERSION }}"
|
|
|
|
# Use awk with index() for exact string match (avoids regex bracket issues)
|
|
CHANGELOG=$(awk -v ver="$VERSION" '
|
|
/^## \[/ {
|
|
if (found) exit
|
|
if (index($0, "[" ver "]") > 0) { found=1; next }
|
|
}
|
|
found { print }
|
|
' CHANGELOG.md)
|
|
|
|
# Handle multiline output
|
|
{
|
|
echo "BODY<<EOF"
|
|
echo "$CHANGELOG"
|
|
echo "EOF"
|
|
} >> $GITHUB_OUTPUT
|
|
|
|
- name: Create release archive
|
|
run: |
|
|
mkdir -p release
|
|
cp install.sh release/
|
|
cp patch_theme_map.sh release/
|
|
cp -r themes release/
|
|
cp README.md release/
|
|
cp CHANGELOG.md release/
|
|
cd release && tar -czvf ../proxmorph-${{ steps.version.outputs.VERSION }}.tar.gz .
|
|
cd .. && zip -r proxmorph-${{ steps.version.outputs.VERSION }}.zip release/
|
|
|
|
- name: Create GitHub Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
name: v${{ steps.version.outputs.VERSION }}
|
|
body: ${{ steps.changelog.outputs.BODY }}
|
|
files: |
|
|
proxmorph-${{ steps.version.outputs.VERSION }}.tar.gz
|
|
proxmorph-${{ steps.version.outputs.VERSION }}.zip
|