Skip to content

Commit

Permalink
#53: Added test for PyPI publish via trusted publisher
Browse files Browse the repository at this point in the history
  • Loading branch information
hkage committed Mar 14, 2024
1 parent 1dc6800 commit 0e4899f
Showing 1 changed file with 13 additions and 19 deletions.
32 changes: 13 additions & 19 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
name: Release

on:
release:
types: [created]
#on:
# release:
# types: [created]

jobs:
publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/pganonymize/
permissions:
id-token: write
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

0 comments on commit 0e4899f

Please sign in to comment.