Setup pypi trusted publishing

This commit is contained in:
Andrew Cassidy 2024-08-26 23:30:05 -07:00
parent 7a8b3c7160
commit 2a39c69700

View File

@ -47,6 +47,11 @@ jobs:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
environment:
name: pypi
url: https://pypi.org/p/yaclog
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
@ -56,25 +61,19 @@ jobs:
with:
python-version: '>=3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install setuptools wheel twine
- name: Install pypa/build
run: python -m pip install build --user
- name: Build a binary wheel and source tarball
run: python -m build --sdist --wheel --outdir dist/
- name: Get version info
- name: Get Changelog Information
id: yaclog-show
uses: ./
# self-hosting!
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Publish to Github
run: |