-
Notifications
You must be signed in to change notification settings - Fork 20
ci(pypi): split the PyPI release process #463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,24 +5,58 @@ name: Publish Python 🐍 distributions 📦 to PyPI | |
|
|
||
| on: | ||
| release: | ||
| # • `released` reacts to stable releases | ||
| # • `prereleased` reacts to pre-releases | ||
| # • `published` reacts to both | ||
| types: [published] | ||
|
|
||
| jobs: | ||
| build-n-publish: | ||
| build: | ||
| name: Build distribution 📦 | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| id-token: write # for trusted publishing | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - uses: actions/setup-python@v4 | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - uses: actions/setup-python@v5 | ||
|
|
||
| - name: Get history and tags for SCM versioning to work | ||
| run: | | ||
| git fetch --prune --unshallow | ||
| git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
|
||
|
|
||
| - name: Build a source tarball and a binary wheel | ||
| # https://pypa-build.readthedocs.io | ||
| run: | | ||
| python -m pip install build | ||
| python -m build | ||
|
|
||
| - name: Store the distribution packages | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: python-package-distributions | ||
| path: dist/ | ||
|
|
||
| publish: | ||
| name: Publish Python 🐍 distribution 📦 to PyPI | ||
| needs: | ||
| - build | ||
| runs-on: ubuntu-latest | ||
| environment: | ||
| name: pypi | ||
| url: https://pypi.org/project/specfile/ | ||
| permissions: | ||
| id-token: write # for trusted publishing | ||
|
|
||
| steps: | ||
| - name: Download all the dists | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: python-package-distributions | ||
| path: dist/ | ||
|
|
||
| - name: Publish 📦 to PyPI | ||
| # https://github.com/pypa/gh-action-pypi-publish | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How come it worked until now without this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have no clue, maybe it was a change in the way github action checkouts the source? I could have a look how we got to this point, but I also think that we started without this and it got added at some point
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
packit/packit@bf36c82
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weren't the scm tools dropped since then? 👀 if it's related to setuptools_scm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setuptools_scm is still around (
specfile/setup.py
Line 15 in 875f03e
specfile/pyproject.toml
Line 9 in 875f03e