Release and publish #21
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 and publish | |
on: [workflow_dispatch] | |
permissions: | |
contents: write | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/get-release-version | |
id: release_version | |
- name: Install poetry | |
run: pipx install poetry | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
cache: poetry | |
- name: Install dependencies | |
run: poetry install --no-interaction --no-root --with dev | |
- name: Build | |
run: poetry build | |
- name: Tag release | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git tag ${{ steps.release_version.outputs.version }} | |
git push origin ${{ steps.release_version.outputs.version }} | |
- name: Create release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: dist/* | |
tag_name: ${{ steps.release_version.outputs.version}} | |
generate_release_notes: true | |
name: ${{ steps.release_version.outputs.version}} | |
- name: Publish | |
run: poetry run twine upload dist/* | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} |