Skip to content

Commit

Permalink
CI: Update publishing workflow
Browse files Browse the repository at this point in the history
Use PyPA's new "Trusted Publisher" thing:
https://docs.pypi.org/trusted-publishers/

Fixes #49
  • Loading branch information
ZedThree committed May 12, 2023
1 parent 80d1fb1 commit 098c1ab
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/python_publish.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
name: Upload Python Package

on:
# Only run when a release is created
release:
types: [created]
types: [published]

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: "3.x"
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
pip install build
- name: Build package
run: python -m build --sdist --wheel
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 098c1ab

Please sign in to comment.