update to v1.6.1, deploy to pypi #7
Workflow file for this run
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 | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: ["master", "emscripten"] | |
| tags: ["v*"] | |
| jobs: | |
| native-wheels: | |
| name: Native wheels (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-14] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install build tooling | |
| run: python -m pip install --upgrade pip cibuildwheel | |
| - name: Build wheels | |
| run: python -m cibuildwheel --output-dir dist | |
| env: | |
| CIBW_BUILD: cp312-* | |
| CIBW_SKIP: pp* *-musllinux_* | |
| CIBW_ARCHS_MACOS: arm64 | |
| CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=26.0 | |
| - name: Upload native wheel artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-${{ matrix.os }} | |
| path: dist/*.whl | |
| wasm-wheel: | |
| name: WASM wheel (Pyodide) | |
| runs-on: ubuntu-latest | |
| env: | |
| PYODIDE_EMSCRIPTEN_TAG: emscripten_3_1_58_wasm32 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install build tooling | |
| run: python -m pip install --upgrade pip build wheel | |
| - name: Build wasm wheel | |
| run: python -m build --wheel | |
| env: | |
| PHREEQPYTHON_TARGET: wasm | |
| - name: Retag wheel for Pyodide | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| WHEEL_PATH=$(ls dist/*.whl) | |
| python -m wheel tags \ | |
| --python-tag cp312 \ | |
| --abi-tag cp312 \ | |
| --platform-tag "${PYODIDE_EMSCRIPTEN_TAG}" \ | |
| "${WHEEL_PATH}" | |
| rm -f "${WHEEL_PATH}" | |
| - name: Upload wasm wheel artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-wasm | |
| path: dist/*.whl | |
| sdist: | |
| name: Source distribution | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install build tooling | |
| run: python -m pip install --upgrade pip build | |
| - name: Build sdist | |
| run: python -m build --sdist | |
| - name: Upload sdist artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sdist | |
| path: dist/*.tar.gz | |
| pypi-publish: | |
| name: Publish to PyPI | |
| needs: [native-wheels, wasm-wheel, sdist] | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Download wheel artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: wheels-* | |
| path: dist | |
| merge-multiple: true | |
| - name: Download sdist artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: sdist | |
| path: dist | |
| - name: Show artifacts | |
| shell: bash | |
| run: ls -la dist | |
| - name: Publish package distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: dist |