Skip to content

Publish to PyPI on release #16

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 5 commits into from
Jun 5, 2023
Merged
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
42 changes: 32 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ on:
- '**.rst'
- 'docs/**'

release:
types:
- published
Comment on lines +16 to +18
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Needed for the new upload_all job below, which has:

if: github.event_name == 'release' && github.event.action == 'published'


concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -21,20 +25,38 @@ jobs:
build_wheels:
strategy:
matrix:
os: ["ubuntu-20.04", "macos-11"]
os: ["ubuntu-latest", "macos-latest"]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

cibuildwheel should take care of the compatibility for older platforms


runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- run: make requirements c_lib
- uses: pypa/[email protected]
- uses: actions/upload-artifact@v3
with:
path: wheelhouse/*.whl

make_sdist:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
make requirements c_lib
- name: Build wheels
uses: pypa/[email protected]
- name: Upload packages
if: github.event_name == 'push'
uses: actions/upload-artifact@v3
- run: |
make requirements
python -m build --no-isolation --sdist
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz

upload_all:
needs: [build_wheels, make_sdist]
runs-on: "ubuntu-latest"
environment: release
if: github.event_name == 'release' && github.event.action == 'published'
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v3
with:
name: ada-url-packages
path: wheelhouse/*
path: wheelhouse
- uses: pypa/gh-action-pypi-publish@release/v1