Skip to content

Commit

Permalink
Update pypi workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
xpai committed Nov 6, 2024
1 parent 218f2f8 commit 52d700d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 24 deletions.
45 changes: 21 additions & 24 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,35 @@ on:
workflow_dispatch:

jobs:
build:
name: Build wheel distribution
pypi-publish:
name: Build package wheel and upload to pypi
runs-on: ubuntu-latest
# Specifying a GitHub environment is optional, but strongly encouraged
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.9
- name: Build a binary wheel and a source tarball
run: |
pip install wheel
python setup.py sdist bdist_wheel
- name: Store the distribution packages
uses: actions/upload-artifact@v3
# - name: Store the distribution packages
# uses: actions/upload-artifact@v3
# with:
# name: python-package-distributions
# path: dist/
# - name: Download all the dists
# uses: actions/download-artifact@v3
# with:
# name: python-package-distributions
# path: dist/
- name: Publish package distributions to pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
name: python-package-distributions
path: dist/

pypi-publish:
name: upload to pypi
runs-on: ubuntu-latest
# Specifying a GitHub environment is optional, but strongly encouraged
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish package distributions to pypi
uses: pypa/gh-action-pypi-publish@release/v1
packages-dir: dist/

0 comments on commit 52d700d

Please sign in to comment.