Availability of 0.1.0 #1
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
| # OxiPhysics PyPI Publishing Workflow | |
| # Author: COOLJAPAN OU (Team Kitasan) | |
| # License: Apache-2.0 | |
| # | |
| # Publishes oxiphysics Python package to PyPI/TestPyPI | |
| # Triggered by: v* tags or manual workflow_dispatch | |
| # Uses OIDC trusted publishing (id-token: write) | |
| name: PyPI Publish | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| publish_target: | |
| description: 'Publish target' | |
| required: true | |
| default: 'testpypi' | |
| type: choice | |
| options: | |
| - testpypi | |
| - pypi | |
| - none | |
| version_tag: | |
| description: 'Version tag (e.g., v0.1.0)' | |
| required: false | |
| type: string | |
| push: | |
| tags: | |
| - 'v*' | |
| env: | |
| CARGO_TERM_COLOR: always | |
| MATURIN_VERSION: "1.8" | |
| PYTHON_PACKAGE: "oxiphysics" | |
| jobs: | |
| linux: | |
| name: Build Linux wheels (${{ matrix.target }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: [x86_64, aarch64] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Build wheels | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| target: ${{ matrix.target }} | |
| args: --release --out dist --find-interpreter | |
| manylinux: auto | |
| working-directory: crates/oxiphysics-python | |
| before-script-linux: | | |
| yum install -y openssl-devel perl-IPC-Cmd || true | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-linux-${{ matrix.target }} | |
| path: crates/oxiphysics-python/dist | |
| macos: | |
| name: Build macOS wheels (${{ matrix.target }}) | |
| runs-on: macos-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: [x86_64, aarch64] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Build wheels | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| target: ${{ matrix.target }} | |
| args: --release --out dist --find-interpreter | |
| working-directory: crates/oxiphysics-python | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-macos-${{ matrix.target }} | |
| path: crates/oxiphysics-python/dist | |
| windows: | |
| name: Build Windows wheels | |
| runs-on: windows-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: [x64] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Build wheels | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| target: ${{ matrix.target }} | |
| args: --release --out dist --find-interpreter | |
| working-directory: crates/oxiphysics-python | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-windows-${{ matrix.target }} | |
| path: crates/oxiphysics-python/dist | |
| sdist: | |
| name: Build source distribution | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Build sdist | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| command: sdist | |
| args: --out dist | |
| working-directory: crates/oxiphysics-python | |
| - name: Upload sdist | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-sdist | |
| path: crates/oxiphysics-python/dist | |
| publish-testpypi: | |
| name: Publish to TestPyPI | |
| runs-on: ubuntu-latest | |
| needs: [linux, macos, windows, sdist] | |
| if: | | |
| (github.event_name == 'workflow_dispatch' && github.event.inputs.publish_target == 'testpypi') || | |
| (github.event_name == 'push' && contains(github.ref, 'rc')) | |
| permissions: | |
| id-token: write | |
| environment: | |
| name: testpypi | |
| url: https://test.pypi.org/project/oxiphysics/ | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| pattern: wheels-* | |
| merge-multiple: true | |
| - name: List distributions | |
| run: ls -la dist/ | |
| - name: Publish to TestPyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| repository-url: https://test.pypi.org/legacy/ | |
| packages-dir: dist/ | |
| skip-existing: true | |
| - name: Verify TestPyPI upload | |
| run: | | |
| sleep 30 | |
| pip index versions --index-url https://test.pypi.org/simple/ ${{ env.PYTHON_PACKAGE }} || echo "Package may still be indexing..." | |
| publish-pypi: | |
| name: Publish to PyPI | |
| runs-on: ubuntu-latest | |
| needs: [linux, macos, windows, sdist] | |
| if: | | |
| (github.event_name == 'workflow_dispatch' && github.event.inputs.publish_target == 'pypi') || | |
| (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, 'rc')) | |
| permissions: | |
| id-token: write | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/project/oxiphysics/ | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| pattern: wheels-* | |
| merge-multiple: true | |
| - name: List distributions | |
| run: ls -la dist/ | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: dist/ | |
| - name: Verify PyPI upload | |
| run: | | |
| sleep 30 | |
| pip index versions ${{ env.PYTHON_PACKAGE }} || echo "Package may still be indexing..." |