| 1 | name: Cargo Publish |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | tags-ignore: |
| 6 | # We don't publish pre-releases for Rust. Crates.io is just a source |
| 7 | # distribution, so we don't need to publish pre-releases. |
| 8 | - 'v*-beta*' |
| 9 | - '*-v*' # for example, python-vX.Y.Z |
| 10 | |
| 11 | env: |
| 12 | # This env var is used by Swatinem/rust-cache@v2 for the cache |
| 13 | # key, so we set it to make sure it is always consistent. |
| 14 | CARGO_TERM_COLOR: always |
| 15 | # Up-to-date compilers needed for fp16kernels. |
| 16 | CC: gcc-12 |
| 17 | CXX: g++-12 |
| 18 | |
| 19 | jobs: |
| 20 | build: |
| 21 | runs-on: ubuntu-22.04 |
| 22 | timeout-minutes: 30 |
| 23 | # Only runs on tags that matches the make-release action |
| 24 | if: startsWith(github.ref, 'refs/tags/v') |
| 25 | steps: |
| 26 | - uses: actions/checkout@v4 |
| 27 | - uses: Swatinem/rust-cache@v2 |
| 28 | with: |
| 29 | workspaces: rust |
| 30 | - name: Install dependencies |
| 31 | run: | |
| 32 | sudo apt update |
| 33 | sudo apt install -y protobuf-compiler libssl-dev |
| 34 | - name: Publish the package |
| 35 | run: | |
| 36 | cargo publish -p lancedb --all-features --token ${{ secrets.CARGO_REGISTRY_TOKEN }} |