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 a35c2f9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 25 deletions.
37 changes: 12 additions & 25 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,25 @@ 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
- name: Build a binary wheel and a source tarball
python-version: 3.9
- name: Build package wheel and source tarball
run: |
pip install wheel
python setup.py sdist bdist_wheel
- name: Store the distribution packages
uses: actions/upload-artifact@v3
- 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 a35c2f9

Please sign in to comment.