Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Enable PyPI publishing from GitHub Actions #27563

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

Merged
merged 2 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 28 additions & 6 deletions .github/workflows/cibuildwheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ jobs:
run: twine check dist/*

- name: Upload sdist result
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: sdist
name: cibw-sdist
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah @QuLogic sorry I didn't review before commenting, but given that you've given distinct names I think everything is fine as you're doing what @henryiii did in https://github.com/scientific-python/cookie/pull/350/files. So I think this is good (without having done it myself). 👍

path: dist/*.tar.gz
if-no-files-found: error

Expand Down Expand Up @@ -140,9 +140,9 @@ jobs:
platforms: arm64

- name: Download sdist
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: sdist
name: cibw-sdist
path: dist/

- name: Build wheels for CPython 3.12
Expand Down Expand Up @@ -186,8 +186,30 @@ jobs:
CIBW_ARCHS: ${{ matrix.cibw_archs }}
if: matrix.cibw_archs != 'aarch64'

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: wheels
name: cibw-wheels-${{ runner.os }}-${{ matrix.cibw_archs }}
path: ./wheelhouse/*.whl
if-no-files-found: error

publish:
if: github.event_name == 'release' && github.event.action == 'published'
name: Upload release to PyPI
needs: [build_sdist, build_wheels]
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- name: Download packages
uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: dist
merge-multiple: true

- name: Print out packages
run: ls dist

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e # v1.8.10
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ jobs:
with:
name: "${{ matrix.python-version }} ${{ matrix.os }} ${{ matrix.name-suffix }}"

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: failure()
with:
name: "${{ matrix.python-version }} ${{ matrix.os }} ${{ matrix.name-suffix }} result images"
Expand Down