Skip to content

Commit

Permalink
publish pypi action
Browse files Browse the repository at this point in the history
  • Loading branch information
dudanov committed May 28, 2024
1 parent 54319f9 commit 280b0d1
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: website

on:
release:
types: [published]

# security: restrict permissions for CI jobs.
permissions:
contents: read

jobs:
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/pyftms
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: Install poetry
uses: abatilo/actions-poetry@v2

- name: Setup a local virtual environment (if no poetry.toml file)
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v3
name: Define a cache for the virtual environment based on the dependencies lock file
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}

- name: Install the project dependencies
run: poetry install

- name: Poetry build
run: poetry build

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 280b0d1

Please sign in to comment.