bug: release upload workflow - bump up to v3 #16
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: Publish and Release Python Package | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write # Required for trusted publishing to PyPI | |
contents: write # Required for creating releases and uploading assets | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
poetry install | |
- name: Run Tests | |
run: poetry run pytest | |
- name: Build the package | |
if: success() | |
run: poetry build | |
- name: Publish to PyPI | |
if: success() | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
- name: Create Release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: true | |
- name: Upload Release Assets | |
uses: AButler/[email protected] | |
with: | |
files: "dist/*" | |
repo-token: ${{ secrets.GITHUB_TOKEN }} |