fix: exclude test data, add caching, optimize release size #10
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: Release | |
| on: | |
| push: | |
| tags: | |
| - "klaw-dbase-v*" | |
| workflow_dispatch: | |
| inputs: | |
| dry_run: | |
| description: "Dry run (don't publish to PyPI)" | |
| required: false | |
| default: true | |
| type: boolean | |
| permissions: | |
| contents: read | |
| env: | |
| PACKAGE_NAME: klaw-dbase | |
| PYTHON_VERSION: "3.13" | |
| DEPOT_TOKEN: ${{ secrets.DEPOT_TOKEN }} | |
| jobs: | |
| linux: | |
| runs-on: ${{ matrix.platform.runner }} | |
| strategy: | |
| matrix: | |
| platform: | |
| - runner: depot-ubuntu-24.04-4 | |
| target: x86_64 | |
| - runner: depot-ubuntu-24.04-arm-4 | |
| target: aarch64 | |
| defaults: | |
| run: | |
| working-directory: workspaces/rust/klaw-dbase | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: workspaces/rust/klaw-dbase | |
| cache-provider: depot | |
| - name: Build wheels | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| target: ${{ matrix.platform.target }} | |
| args: --release --out dist | |
| sccache: "true" | |
| manylinux: auto | |
| working-directory: workspaces/rust/klaw-dbase | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-linux-${{ matrix.platform.target }} | |
| path: workspaces/rust/klaw-dbase/dist | |
| musllinux: | |
| runs-on: ${{ matrix.platform.runner }} | |
| strategy: | |
| matrix: | |
| platform: | |
| - runner: depot-ubuntu-24.04-4 | |
| target: x86_64 | |
| - runner: depot-ubuntu-24.04-arm-4 | |
| target: aarch64 | |
| defaults: | |
| run: | |
| working-directory: workspaces/rust/klaw-dbase | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: workspaces/rust/klaw-dbase | |
| cache-provider: depot | |
| - name: Build wheels | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| target: ${{ matrix.platform.target }} | |
| args: --release --out dist | |
| sccache: "true" | |
| manylinux: musllinux_1_2 | |
| working-directory: workspaces/rust/klaw-dbase | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-musllinux-${{ matrix.platform.target }} | |
| path: workspaces/rust/klaw-dbase/dist | |
| windows: | |
| runs-on: ${{ matrix.platform.runner }} | |
| strategy: | |
| matrix: | |
| platform: | |
| - runner: depot-windows-2022-4 | |
| target: x64 | |
| defaults: | |
| run: | |
| working-directory: workspaces/rust/klaw-dbase | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: workspaces/rust/klaw-dbase | |
| cache-provider: depot | |
| - name: Build wheels | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| target: ${{ matrix.platform.target }} | |
| args: --release --out dist | |
| sccache: "true" | |
| working-directory: workspaces/rust/klaw-dbase | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-windows-${{ matrix.platform.target }} | |
| path: workspaces/rust/klaw-dbase/dist | |
| macos: | |
| runs-on: macos-15 | |
| strategy: | |
| matrix: | |
| platform: | |
| - target: aarch64 | |
| defaults: | |
| run: | |
| working-directory: workspaces/rust/klaw-dbase | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: workspaces/rust/klaw-dbase | |
| - name: Build wheels | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| target: ${{ matrix.platform.target }} | |
| args: --release --out dist | |
| sccache: "true" | |
| working-directory: workspaces/rust/klaw-dbase | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-macos-${{ matrix.platform.target }} | |
| path: workspaces/rust/klaw-dbase/dist | |
| sdist: | |
| runs-on: depot-ubuntu-24.04-4 | |
| defaults: | |
| run: | |
| working-directory: workspaces/rust/klaw-dbase | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build sdist | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| command: sdist | |
| args: --out dist | |
| working-directory: workspaces/rust/klaw-dbase | |
| - name: Upload sdist | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheels-sdist | |
| path: workspaces/rust/klaw-dbase/dist | |
| publish: | |
| name: Publish to PyPI | |
| runs-on: depot-ubuntu-24.04-4 | |
| needs: [linux, musllinux, windows, macos, sdist] | |
| if: startsWith(github.ref, 'refs/tags/') && !inputs.dry_run | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/klaw-dbase | |
| permissions: | |
| id-token: write | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: wheels-* | |
| path: dist | |
| merge-multiple: true | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |