All checks were successful
Test Action / Test Node (pull_request) Successful in 14s
Test Action / Test nginx (pull_request) Successful in 16s
Test Action / Test Custom Server Path (pull_request) Successful in 23s
Test Action / Test Build Command (pull_request) Successful in 25s
Test Action / Test PHP (pull_request) Successful in 52s
Test Action / Test All Components (pull_request) Successful in 1m10s
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
60 lines
1.8 KiB
YAML
60 lines
1.8 KiB
YAML
name: Release
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
release:
|
|
name: Create Release
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6.0.2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Get version from tag
|
|
id: version
|
|
run: |
|
|
VERSION=${GITHUB_REF#refs/tags/v}
|
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Extract changelog
|
|
id: changelog
|
|
run: |
|
|
VERSION=${{ steps.version.outputs.version }}
|
|
# Extract the changelog section for this version
|
|
CHANGELOG=$(sed -n "/## \[$VERSION\]/,/## \[/p" CHANGELOG.md | sed '$d')
|
|
# Use a delimiter to handle multiline
|
|
echo "changelog<<EOF" >> $GITHUB_OUTPUT
|
|
echo "$CHANGELOG" >> $GITHUB_OUTPUT
|
|
echo "EOF" >> $GITHUB_OUTPUT
|
|
|
|
- name: Create GitHub Release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ steps.version.outputs.tag }}
|
|
release_name: Release ${{ steps.version.outputs.tag }}
|
|
body: ${{ steps.changelog.outputs.changelog }}
|
|
draft: false
|
|
prerelease: false
|
|
|
|
- name: Update major version tag
|
|
run: |
|
|
VERSION=${{ steps.version.outputs.version }}
|
|
MAJOR_VERSION=$(echo $VERSION | cut -d. -f1)
|
|
|
|
git config user.name github-actions
|
|
git config user.email github-actions@github.com
|
|
|
|
# Force update the major version tag
|
|
git tag -fa "v$MAJOR_VERSION" -m "Update v$MAJOR_VERSION to $VERSION"
|
|
git push origin "v$MAJOR_VERSION" --force
|