Skip to content

feat: add etcd store registries with versioned migration #45

feat: add etcd store registries with versioned migration

feat: add etcd store registries with versioned migration #45

Workflow file for this run

name: Rust Publish
on:
release:
types:
- released
pull_request:
paths:
- .github/workflows/rust-publish.yml
- Cargo.toml
- crates/**/Cargo.toml
workflow_dispatch:
inputs:
mode:
description: "dry_run: build & test only, release: build & publish to crates.io"
required: true
default: dry_run
type: choice
options:
- dry_run
- release
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-C debuginfo=1"
RUST_BACKTRACE: "1"
CARGO_INCREMENTAL: "0"
CARGO_BUILD_JOBS: "1"
jobs:
publish:
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y clang libclang-dev protobuf-compiler libssl-dev
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
cache: false
- uses: rui314/setup-mold@v1
- name: Validate registry metadata
run: |
python3 - <<'PY'
import json
import subprocess
metadata = json.loads(
subprocess.check_output(
["cargo", "metadata", "--no-deps", "--format-version", "1", "--locked"],
text=True,
)
)
errors = []
for package in metadata["packages"]:
if package["publish"] == []:
continue
if not (package.get("description") or "").strip():
errors.append(f"{package['name']}: missing description")
if not package.get("license") and not package.get("license_file"):
errors.append(f"{package['name']}: missing license or license-file")
if errors:
raise SystemExit("\n".join(errors))
print("All publishable crates have the required registry metadata")
PY
- name: Validate Rust crate packages
if: github.event_name == 'pull_request'
run: cargo package --workspace --exclude lance-context-python --allow-dirty --no-verify --all-features --locked
- name: Publish Rust crates
if: github.event_name != 'pull_request'
uses: katyo/publish-crates@v2
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
args: "--all-features"
path: .
dry-run: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.mode == 'dry_run' }}