Skip to content

Release v3.0.1

Release v3.0.1 #27

Workflow file for this run

name: Release
on:
workflow_dispatch:
pull_request:
types: [closed]
env:
VERSION: ${{ github.event.inputs.version }}
#todo get rid of empty line top of release log
jobs:
perform:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release') }}
steps:
- name: Set VERSION variable from tag
run: |
VERSION=${{github.head_ref}}
echo "VERSION=${VERSION##*/}" >> $GITHUB_ENV
- name: Checkout repository code
uses: actions/checkout@v4
with:
fetch-depth: 0
# skip generating assets, which potentially requires setup-go
- name: Fetch Changelog
run: sed -n "/^## \[Unreleased\]$/,/^##/{/## \[/b; /^$/b; p}" CHANGELOG.md > ${{env.VERSION}}-CHANGELOG.md
- name: show notes
run: sed -n "/^## \[Unreleased\]$/,/^##/{/## \[/b; /^$/b; p}" CHANGELOG.md
# todo: revert release files back to the assets
# the second ${{env.VERSION}} is the tag see https://cli.github.com/manual/gh_release_create
- run: gh release create --draft --notes-file ${{env.VERSION}}-CHANGELOG.md --title ${{env.VERSION}} ${{env.VERSION}} ./random.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# placeholder for slack notification