.github/workflows/release.yaml
name: Release
on:
push:
tags:
- '*'
jobs:
# Job: Create release
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
# Check if tag is valid
- name: Check tag
run: |
if ! [[ ${{ github.ref }} =~ ^refs/tags/[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$ ]]; then
exit 1
fi
# Read changelog
- name: Read changelog
id: changelog
uses: mindsers/changelog-reader-action@v2
with:
validation_level: warn
# Create release
- name: Create release
id: create-release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: ${{ steps.changelog.outputs.changes }}