Update make wheels command #7
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: Build Wheels and Release | |
| on: | |
| push: | |
| branches: | |
| - "wheels-workflow" | |
| # - "main" | |
| workflow_dispatch: {} | |
| permissions: | |
| contents: write | |
| env: | |
| CARGO_TERM_COLOR: always | |
| # Prefer building portable abi3 wheels without requiring a build-time interpreter. | |
| PYO3_NO_PYTHON: "1" | |
| jobs: | |
| wheels: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install maturin | |
| run: python -m pip install -U pip maturin | |
| - name: Build wheels | |
| working-directory: ooniauth-py | |
| run: make wheels | |
| - name: Compute release tag name | |
| id: tag | |
| run: | | |
| SHORT_SHA="${GITHUB_SHA::7}" | |
| TAG="ooniauth-py-${SHORT_SHA}-${GITHUB_RUN_NUMBER}" | |
| echo "tag=$TAG" >> "$GITHUB_OUTPUT" | |
| - name: Upload wheels to GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.tag.outputs.tag }} | |
| name: ${{ steps.tag.outputs.tag }} | |
| target_commitish: ${{ github.sha }} | |
| generate_release_notes: true | |
| files: | | |
| ooniauth-py/wheels/*.whl | |
| - name: Check wheel artifacts | |
| run: | | |
| echo "Listing ooniauth-py/wheels:" | |
| ls -la ooniauth-py/wheels || true | |
| echo "Wheel files:" | |
| ls -la ooniauth-py/wheels/*.whl || true | |
| - name: Stage wheels for PyPI | |
| run: | | |
| mkdir -p dist | |
| cp -v ooniauth-py/wheels/*.whl dist/ | |
| echo "Staged wheel files:" | |
| ls -la dist | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| password: ${{ secrets.PYPI_API_TOKEN }} | |
| packages-dir: dist |