Skip to content

release

release #116

Workflow file for this run

name: release
on:
workflow_run:
workflows:
- test
branches: [main]
types:
- completed
jobs:
release:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Build
run: |
poetry build --no-interaction
echo "RELEASE_NAME=$(poetry version)" >> $GITHUB_ENV
echo "TAG_NAME=v$(poetry version -s)" >> $GITHUB_ENV
echo "## Release notes" > NOTES.md
sed -n '/^## /{n; :a; /^## /q; p; n; ba}' CHANGELOG.md >> NOTES.md
- name: Release
uses: softprops/action-gh-release@v1
with:
fail_on_unmatched_files: true
append_body: true
name: ${{ env.RELEASE_NAME }}
tag_name: ${{ env.TAG_NAME }}
body_path: ./NOTES.md
files: ./dist/*
- name: Publish
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: poetry publish