(version) 0.1.5 #7
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release & Publish | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
permissions: | |
contents: write | |
packages: write | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }} | |
- name: Get version from tag | |
id: get_version | |
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
- name: Update version and build | |
run: | | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
poetry version ${{ steps.get_version.outputs.VERSION }} | |
poetry build | |
- name: Create GitHub Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: Release ${{ steps.get_version.outputs.VERSION }} | |
draft: false | |
prerelease: false | |
files: | | |
dist/* | |
generate_release_notes: true | |
fail_on_unmatched_files: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish to PyPI | |
run: poetry publish --no-interaction |