Fix: Update workflow to publish to PyPI on release

This commit is contained in:
w4nn4d13
2026-04-06 22:59:56 +05:30
parent 5248e04d0a
commit 08ac54bd6a
@@ -1,4 +1,4 @@
name: Publish to GitHub Packages name: Publish to PyPI
on: on:
release: release:
@@ -8,15 +8,12 @@ on:
jobs: jobs:
build-and-publish: build-and-publish:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v3
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v4 uses: actions/setup-python@v3
with: with:
python-version: '3.9' python-version: '3.9'
@@ -28,10 +25,9 @@ jobs:
- name: Build distribution packages - name: Build distribution packages
run: python -m build run: python -m build
- name: Publish to GitHub Packages - name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: | run: |
python -m twine upload dist/* \ python -m twine upload dist/* --verbose
--repository-url https://python.pkg.github.com/${{ github.repository_owner }} \
--username ${{ github.actor }} \
--password ${{ secrets.GITHUB_TOKEN }} \
--verbose