Add install_name_tool wrapper #56
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
| name: PyPI | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ['v*'] | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }} | |
| cancel-in-progress: true | |
| jobs: | |
| macos: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: aarch64-apple-darwin | |
| - name: Build | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| target: universal2-apple-darwin | |
| args: --release --out dist --strip | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: wheels-macos-universal2 | |
| path: dist | |
| windows: | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| platform: | |
| - arch: x64 | |
| target: x86_64-pc-windows-msvc | |
| - arch: x86 | |
| target: i686-pc-windows-msvc | |
| - arch: arm64 | |
| target: aarch64-pc-windows-msvc | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Build | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| target: ${{ matrix.platform.target }} | |
| args: --release --out dist --strip | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: wheels-${{ matrix.platform.arch }} | |
| path: dist | |
| linux: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| platform: | |
| [ | |
| { target: 'x86_64-unknown-linux-musl', image_tag: 'x86_64-musl' }, | |
| { target: 'i686-unknown-linux-musl', image_tag: 'i686-musl' }, | |
| { target: 'aarch64-unknown-linux-musl', image_tag: 'aarch64-musl' }, | |
| { | |
| target: 'armv7-unknown-linux-musleabihf', | |
| image_tag: 'armv7-musleabihf', | |
| }, | |
| { | |
| target: 'armv7-unknown-linux-musleabi', | |
| image_tag: 'armv7-musleabi', | |
| }, | |
| ] | |
| container: | |
| image: docker://ghcr.io/rust-cross/rust-musl-cross:${{ matrix.platform.image_tag }} | |
| env: | |
| CFLAGS_armv7_unknown_linux_musleabihf: '-mfpu=vfpv3-d16' | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Build | |
| uses: PyO3/maturin-action@main | |
| with: | |
| target: ${{ matrix.platform.target }} | |
| manylinux: auto | |
| container: off | |
| args: --release -o dist --strip | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: wheels-${{ matrix.platform.target }} | |
| path: dist | |
| release: | |
| name: Release PyPI | |
| runs-on: ubuntu-slim | |
| if: "startsWith(github.ref, 'refs/tags/')" | |
| needs: [macos, windows, linux] | |
| environment: | |
| name: PyPI | |
| url: https://pypi.org/project/cargo-zigbuild/ | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/download-artifact@v7 | |
| with: | |
| pattern: wheels-* | |
| merge-multiple: true | |
| - uses: astral-sh/setup-uv@v7 | |
| - name: Publish to PyPI | |
| run: uv publish --trusted-publishing always *.whl |