Skip to content

Commit

Permalink
add pypi trusted publishing workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
d33bs committed Dec 30, 2024
1 parent f2ac788 commit 44eef4b
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
# used for publishing packages to pypi on release
name: publish pypi release

on:
release:
types:
- published

jobs:
publish_pypi:
runs-on: ubuntu-latest
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch tags
run: git fetch --all --tags
- name: Python setup
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Setup for poetry
run: |
python -m pip install poetry
poetry self add "poetry-dynamic-versioning[plugin]"
- name: Install environment
run: poetry install --no-interaction --no-ansi
- name: poetry build distribution content
run: poetry build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 44eef4b

Please sign in to comment.