Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 12 additions & 93 deletions .bumpversion.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[tool.bumpversion]
current_version = "0.32.1"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)(-(?P<prerelease>.+))?"
current_version = "0.40.0-beta.1"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)(-(?P<prerelease>(beta|rc))\\.(?P<prerelease_num>\\d+))?"
serialize = [
"{major}.{minor}.{patch}-{prerelease}",
"{major}.{minor}.{patch}-{prerelease}.{prerelease_num}",
"{major}.{minor}.{patch}"
]
search = "{current_version}"
Expand All @@ -18,6 +18,13 @@ allow_dirty = false
commit = false
message = "chore: bump version {current_version} → {new_version}"

[tool.bumpversion.parts.prerelease]
optional_value = "stable"
values = ["beta", "rc", "stable"]

[tool.bumpversion.parts.prerelease_num]
first_value = "0"

[[tool.bumpversion.files]]
filename = "Cargo.toml"
search = 'version = "{current_version}"'
Expand Down Expand Up @@ -108,96 +115,8 @@ filename = "Cargo.toml"
search = 'lance-bitpacking = {{ version = "={current_version}"'
replace = 'lance-bitpacking = {{ version = "={new_version}"'

# Update all rust crate Cargo.toml files
[[tool.bumpversion.files]]
filename = "rust/lance/Cargo.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'

[[tool.bumpversion.files]]
filename = "rust/lance-arrow/Cargo.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'

[[tool.bumpversion.files]]
filename = "rust/lance-core/Cargo.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'

[[tool.bumpversion.files]]
filename = "rust/lance-datafusion/Cargo.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'

[[tool.bumpversion.files]]
filename = "rust/lance-datagen/Cargo.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'

[[tool.bumpversion.files]]
filename = "rust/lance-encoding/Cargo.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'

[[tool.bumpversion.files]]
filename = "rust/lance-file/Cargo.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'

[[tool.bumpversion.files]]
filename = "rust/lance-index/Cargo.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'

[[tool.bumpversion.files]]
filename = "rust/lance-io/Cargo.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'

[[tool.bumpversion.files]]
filename = "rust/lance-linalg/Cargo.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'

[[tool.bumpversion.files]]
filename = "rust/lance-namespace/Cargo.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'

[[tool.bumpversion.files]]
filename = "rust/lance-namespace-impls/Cargo.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'

[[tool.bumpversion.files]]
filename = "rust/lance-table/Cargo.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'

[[tool.bumpversion.files]]
filename = "rust/compression/bitpacking/Cargo.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'

[[tool.bumpversion.files]]
filename = "rust/compression/fsst/Cargo.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'

[[tool.bumpversion.files]]
filename = "rust/lance-test-macros/Cargo.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'

[[tool.bumpversion.files]]
filename = "rust/lance-testing/Cargo.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'

[[tool.bumpversion.files]]
filename = "rust/examples/Cargo.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'
# Note: Individual rust crate Cargo.toml files use workspace = true,
# so we don't need to update them individually

# Python Cargo.toml
[[tool.bumpversion.files]]
Expand Down
26 changes: 26 additions & 0 deletions .github/actions/setup-release-env/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 'Setup Release Environment'
description: 'Sets up Python, Rust, and dependencies for release workflows (assumes repo is already checked out)'
runs:
using: "composite"
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install dependencies
shell: bash
run: |
pip install bump-my-version packaging PyGithub

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Configure git identity
shell: bash
run: |
git config user.name 'Lance Release Bot'
git config user.email 'lance-dev@lancedb.com'
113 changes: 113 additions & 0 deletions .github/workflows/approve-rc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: Approve RC

on:
workflow_dispatch:
inputs:
rc_tag:
description: 'RC tag to approve (e.g., v1.3.0-rc.2 or v1.3.1-rc.1)'
required: true
type: string
dry_run:
description: 'Dry run (simulate without pushing)'
required: true
default: false
type: boolean

jobs:
approve-rc:
runs-on: ubuntu-latest
outputs:
stable_version: ${{ steps.approve.outputs.STABLE_VERSION }}
stable_tag: ${{ steps.approve.outputs.STABLE_TAG }}
release_branch: ${{ steps.approve.outputs.RELEASE_BRANCH }}
is_major_minor: ${{ steps.approve.outputs.IS_MAJOR_MINOR }}
previous_tag: ${{ steps.approve.outputs.PREVIOUS_TAG }}
steps:
- name: Output Inputs
run: echo "${{ toJSON(github.event.inputs) }}"

- name: Check out repository
uses: actions/checkout@v4
with:
token: ${{ secrets.LANCE_RELEASE_TOKEN }}
fetch-depth: 0
lfs: true

- name: Setup release environment
uses: ./.github/actions/setup-release-env

- name: Approve RC
id: approve
run: |
bash ci/approve_rc.sh "${{ inputs.rc_tag }}"

- name: Push changes (if not dry run)
if: ${{ !inputs.dry_run }}
run: |
git push origin "${{ steps.approve.outputs.RELEASE_BRANCH }}"
git push origin "${{ steps.approve.outputs.STABLE_TAG }}"

- name: Generate Release Notes (if not dry run)
if: ${{ !inputs.dry_run }}
id: release_notes
env:
GH_TOKEN: ${{ secrets.LANCE_RELEASE_TOKEN }}
run: |
PREVIOUS_TAG="${{ steps.approve.outputs.PREVIOUS_TAG }}"
STABLE_TAG="${{ steps.approve.outputs.STABLE_TAG }}"

if [ -n "${PREVIOUS_TAG}" ]; then
echo "Generating release notes from ${PREVIOUS_TAG} to ${STABLE_TAG}"
NOTES=$(gh api repos/${{ github.repository }}/releases/generate-notes \
-f tag_name="${STABLE_TAG}" \
-f previous_tag_name="${PREVIOUS_TAG}" \
--jq .body)
else
echo "No previous tag found, using automatic generation"
NOTES=$(gh api repos/${{ github.repository }}/releases/generate-notes \
-f tag_name="${STABLE_TAG}" \
--jq .body)
fi

# Save to output
echo "notes<<EOF" >> $GITHUB_OUTPUT
echo "$NOTES" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

- name: Create GitHub Release (if not dry run)
if: ${{ !inputs.dry_run }}
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.approve.outputs.STABLE_TAG }}
name: ${{ steps.approve.outputs.STABLE_TAG }}
draft: false
prerelease: false
body: ${{ steps.release_notes.outputs.notes }}
token: ${{ secrets.LANCE_RELEASE_TOKEN }}

- name: Summary
run: |
echo "## Stable Release Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **RC Tag:** ${{ inputs.rc_tag }}" >> $GITHUB_STEP_SUMMARY
echo "- **Stable Version:** ${{ steps.approve.outputs.STABLE_VERSION }}" >> $GITHUB_STEP_SUMMARY
echo "- **Stable Tag:** ${{ steps.approve.outputs.STABLE_TAG }}" >> $GITHUB_STEP_SUMMARY
echo "- **Release Branch:** ${{ steps.approve.outputs.RELEASE_BRANCH }}" >> $GITHUB_STEP_SUMMARY
echo "- **Next Version:** ${{ steps.approve.outputs.NEXT_BETA_VERSION }}" >> $GITHUB_STEP_SUMMARY
echo "- **Release Type:** $( [ "${{ steps.approve.outputs.IS_MAJOR_MINOR }}" == "true" ] && echo "Major/Minor" || echo "Patch" )" >> $GITHUB_STEP_SUMMARY
if [ -n "${{ steps.approve.outputs.PREVIOUS_TAG }}" ]; then
echo "- **Release Notes From:** ${{ steps.approve.outputs.PREVIOUS_TAG }}" >> $GITHUB_STEP_SUMMARY
fi
echo "- **Dry Run:** ${{ inputs.dry_run }}" >> $GITHUB_STEP_SUMMARY

if [ "${{ inputs.dry_run }}" == "true" ]; then
echo "" >> $GITHUB_STEP_SUMMARY
echo "⚠️ This was a dry run. No changes were pushed." >> $GITHUB_STEP_SUMMARY
else
echo "" >> $GITHUB_STEP_SUMMARY
echo "✅ Stable release ${{ steps.approve.outputs.STABLE_TAG }} complete!" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Publishing:** Stable artifacts will be published to PyPI, crates.io, Maven Central" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Auto-bumped:** Release branch bumped to ${{ steps.approve.outputs.NEXT_BETA_VERSION }}" >> $GITHUB_STEP_SUMMARY
fi
47 changes: 0 additions & 47 deletions .github/workflows/bump-version/action.yml

This file was deleted.

25 changes: 24 additions & 1 deletion .github/workflows/cargo-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,32 @@ jobs:
working-directory: .
steps:
- uses: actions/checkout@v4
- name: Check if stable release
id: check_version
run: |
# Get the tag from the event
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
TAG="${{ github.event.inputs.tag }}"
else
TAG="${{ github.ref_name }}"
fi
echo "Checking tag: $TAG"

# Skip if tag contains -beta or -rc (not a stable release)
if [[ "$TAG" == *-beta.* ]] || [[ "$TAG" == *-rc.* ]]; then
echo "Skipping cargo publish for non-stable version: $TAG"
echo "Only stable versions (without -beta or -rc) are published to crates.io"
echo "skip=true" >> $GITHUB_OUTPUT
else
echo "Stable version detected: $TAG"
echo "skip=false" >> $GITHUB_OUTPUT
fi
- uses: Swatinem/rust-cache@v2
if: steps.check_version.outputs.skip != 'true'
with:
workspaces: rust
- name: Verify and checkout specified tag
if: github.event_name == 'workflow_dispatch'
if: github.event_name == 'workflow_dispatch' && steps.check_version.outputs.skip != 'true'
run: |
git fetch --all --tags
if git rev-parse ${{ github.event.inputs.tag }} >/dev/null 2>&1; then
Expand All @@ -52,13 +73,15 @@ jobs:
exit 1
fi
- name: Install dependencies
if: steps.check_version.outputs.skip != 'true'
run: |
sudo apt update
sudo apt install -y protobuf-compiler libssl-dev
# Wait until https://github.com/rust-lang/crates-io-auth-action/issues/51 fixed
# - uses: rust-lang/crates-io-auth-action@v1
# id: auth
- uses: albertlockett/publish-crates@v2.2
if: steps.check_version.outputs.skip != 'true'
with:
# registry-token: ${{ steps.auth.outputs.token }}
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
Expand Down
Loading
Loading