-
Notifications
You must be signed in to change notification settings - Fork 967
Publishes pyo3-introspection as a wheel on Pypi #6018
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
+140
−0
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1dafc87
Publishes the binary as a wheel on Pypi
Tpt 1e1f9d2
Fix artifact upload path
Tpt b87c2e2
Stop running on PRs
Tpt d328334
Allow publishing on workflow_dispatch if it's on a tag
Tpt c0b7938
Update .github/workflows/python-wheel.yml
Tpt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| name: Build and release wheels | ||
|
|
||
| on: | ||
| merge_group: | ||
| types: [ checks_requested ] | ||
| workflow_dispatch: | ||
| push: | ||
| tags: | ||
| - "v*" | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| pypi_linux: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| target: [x86_64, x86, aarch64, armv7, s390x, ppc64le] | ||
| steps: | ||
| - uses: actions/checkout@v6.0.2 | ||
| - uses: PyO3/maturin-action@v1 | ||
| with: | ||
| target: ${{ matrix.target }} | ||
| args: --release --out dist --compatibility pypi | ||
| manylinux: auto | ||
| working-directory: pyo3-introspection | ||
| - uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: wheels-linux-${{ matrix.target }} | ||
| path: pyo3-introspection/dist | ||
|
|
||
| pypi_windows: | ||
| runs-on: ${{ matrix.platform.runner }} | ||
| strategy: | ||
| matrix: | ||
| platform: | ||
| - runner: windows-latest | ||
| target: x64 | ||
| - runner: windows-latest | ||
| target: x86 | ||
| - runner: windows-11-arm | ||
| target: aarch64 | ||
| steps: | ||
| - uses: actions/checkout@v6.0.2 | ||
| - name: Build wheels | ||
| uses: PyO3/maturin-action@v1 | ||
| with: | ||
| target: ${{ matrix.platform.target }} | ||
| args: --release --out dist --compatibility pypi | ||
| working-directory: pyo3-introspection | ||
| - uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: wheels-windows-${{ matrix.platform.target }} | ||
| path: pyo3-introspection/dist | ||
|
|
||
| pypi_macos: | ||
| runs-on: ${{ matrix.platform.runner }} | ||
| strategy: | ||
| matrix: | ||
| platform: | ||
| - runner: macos-15-intel | ||
| target: x86_64 | ||
| - runner: macos-latest | ||
| target: aarch64 | ||
| steps: | ||
| - uses: actions/checkout@v6.0.2 | ||
| - uses: PyO3/maturin-action@v1 | ||
| with: | ||
| target: ${{ matrix.platform.target }} | ||
| args: --release --out dist --compatibility pypi | ||
| working-directory: pyo3-introspection | ||
| - uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: wheels-macos-${{ matrix.platform.target }} | ||
| path: pyo3-introspection/dist | ||
|
|
||
| pypi_sdist: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6.0.2 | ||
| - uses: PyO3/maturin-action@v1 | ||
| with: | ||
| command: sdist | ||
| args: --out dist | ||
| working-directory: pyo3-introspection | ||
| - uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: wheels-sdist | ||
| path: pyo3-introspection/dist | ||
|
|
||
| pypi_release: | ||
| if: startsWith(github.ref, 'refs/tags/') | ||
| permissions: | ||
| id-token: write | ||
|
|
||
| runs-on: ubuntu-latest | ||
| environment: release | ||
| needs: [pypi_linux, pypi_windows, pypi_macos, pypi_sdist] | ||
| steps: | ||
| - uses: actions/download-artifact@v8 | ||
| with: | ||
| pattern: wheels-* | ||
| path: pyo3-introspection/dist | ||
| merge-multiple: true | ||
| - uses: pypa/gh-action-pypi-publish@release/v1 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| [project] | ||
| name = "pyo3-introspection" | ||
| classifiers = [ | ||
| "Development Status :: 3 - Alpha", | ||
| "Intended Audience :: Developers", | ||
| "License :: OSI Approved :: Apache Software License", | ||
| "License :: OSI Approved :: MIT License", | ||
| "Programming Language :: Rust", | ||
| ] | ||
| dynamic = [ | ||
| "authors", | ||
| "description", | ||
| "keywords", | ||
| "license", | ||
| "license-files", | ||
| "maintainers", | ||
| "readme", | ||
| "version", | ||
| ] | ||
|
|
||
| [project.urls] | ||
| Changelog = "https://github.com/PyO3/pyo3/blob/main/CHANGELOG.md" | ||
| Documentation = "https://pyo3.rs/" | ||
| Homepage = "https://pyo3.rs/" | ||
| Source = "https://github.com/PyO3/pyo3/tree/main/pyo3-introspection" | ||
| Tracker = "https://github.com/PyO3/pyo3/issues" | ||
|
|
||
| [build-system] | ||
| requires = ["maturin>=1,<2"] | ||
| build-backend = "maturin" | ||
|
|
||
| [tool.maturin] | ||
| bindings = "bin" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Was this copied from
release.ymlwhich also hasworkflow_dispatchevent? I think having this can allow re-running the release if it fails, however maybe we should restrict it to tags to prevent accidental release on untagged stuff? (We might want to fix it onrelease.ymlto only allow tags too?)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.
The
pypi_releasejob is gated on tag push. So, it should not be possible to publish outside of a tag. I have relaxed a bit the constraint to also allow manual runs on tags: d328334