qrm2/.github/workflows/release.yml

63 lines
1.7 KiB
YAML

# vim: ts=2 sw=2:
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
name: Create Release
jobs:
release:
name: Create Release
runs-on: ubuntu-20.04
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- name: Get Version Info
id: get_tag
shell: bash
run: |
SUBJECT=$(/usr/bin/git tag -l ${GITHUB_REF#refs/tags/} --format='%(subject)')
BODY=$(/usr/bin/git tag -l ${GITHUB_REF#refs/tags/} --format='%(body)' | sed '/-----BEGIN PGP SIGNATURE-----/,$d')
echo "SUBJECT=$SUBJECT"
echo "BODY=$BODY"
echo 'tag_subject<<EOS' >> $GITHUB_ENV
echo "$SUBJECT" >> $GITHUB_ENV
echo 'EOS' >> $GITHUB_ENV
echo 'tag_body<<EOB' >> $GITHUB_ENV
echo "$BODY" >> $GITHUB_ENV
echo 'EOB' >> $GITHUB_ENV
echo "tag_version=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
echo "version_num=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Get Changelog Content
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
version: ${{ env.version_num }}
path: ./CHANGELOG.md
- name: Publish Release
id: create_release
uses: ncipollo/release-action@v1
with:
tag: ${{ env.tag_version }}
name: ${{ env.tag_subject }}
body: |
${{ env.tag_body }}
## Changelog
${{ steps.changelog_reader.outputs.changes }}
draft: false
prerelease: false