Publish to PyPI #2
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 to PyPI | |
on: | |
release: | |
types: [created] | |
workflow_dispatch: {} | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Python | |
run: apt-get update && apt-get install -y python3-dev python3-venv | |
- name: Install Poetry | |
run: | | |
apt-get update | |
apt-get install -y python3.10-dev python3.10-venv | |
mkdir -p /usr/local/poetry | |
python3.10 -m venv /usr/local/poetry | |
/usr/local/poetry/bin/pip install poetry==1.6 | |
ln -s /usr/local/poetry/bin/poetry /bin/poetry | |
export PATH=/bin:$PATH | |
- name: Install Package | |
run: poetry install | |
- name: Test Package | |
run: poetry run pytest | |
- name: Build Package Distributions | |
run: poetry build | |
- name: Publish Package Distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |