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