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
90 changes: 90 additions & 0 deletions .bumpversion.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
[tool.bumpversion]
current_version = "0.0.10"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
serialize = ["{major}.{minor}.{patch}"]
search = "{current_version}"
replace = "{new_version}"
regex = false
ignore_missing_files = false
ignore_missing_version = false
tag = false
sign_tags = false
tag_name = "v{new_version}"
tag_message = "Release version {new_version}"
allow_dirty = false
commit = false
message = "chore: bump version {current_version} → {new_version}"

# Makefiles - VERSION variable
[[tool.bumpversion.files]]
filename = "java/Makefile"
search = "VERSION = {current_version}"
replace = "VERSION = {new_version}"

[[tool.bumpversion.files]]
filename = "python/Makefile"
search = "VERSION = {current_version}"
replace = "VERSION = {new_version}"

[[tool.bumpversion.files]]
filename = "rust/Makefile"
search = "VERSION = {current_version}"
replace = "VERSION = {new_version}"

# Java pom.xml files (non-auto-generated)
[[tool.bumpversion.files]]
filename = "java/pom.xml"
search = "<version>{current_version}</version>"
replace = "<version>{new_version}</version>"

[[tool.bumpversion.files]]
filename = "java/lance-namespace-core/pom.xml"
search = "<version>{current_version}</version>"
replace = "<version>{new_version}</version>"

[[tool.bumpversion.files]]
filename = "java/lance-namespace-adapter/pom.xml"
search = "<version>{current_version}</version>"
replace = "<version>{new_version}</version>"

[[tool.bumpversion.files]]
filename = "java/lance-namespace-hive2/pom.xml"
search = "<version>{current_version}</version>"
replace = "<version>{new_version}</version>"

[[tool.bumpversion.files]]
filename = "java/lance-namespace-hive3/pom.xml"
search = "<version>{current_version}</version>"
replace = "<version>{new_version}</version>"

[[tool.bumpversion.files]]
filename = "java/lance-namespace-glue/pom.xml"
search = "<version>{current_version}</version>"
replace = "<version>{new_version}</version>"

[[tool.bumpversion.files]]
filename = "java/lance-namespace-unity/pom.xml"
search = "<version>{current_version}</version>"
replace = "<version>{new_version}</version>"

[[tool.bumpversion.files]]
filename = "java/lance-namespace-lancedb/pom.xml"
search = "<version>{current_version}</version>"
replace = "<version>{new_version}</version>"

# Python pyproject.toml files (non-auto-generated)
[[tool.bumpversion.files]]
filename = "python/lance_namespace/pyproject.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'

[[tool.bumpversion.files]]
filename = "python/pyproject.urllib3_client.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'

# Rust Cargo.toml files (non-auto-generated)
[[tool.bumpversion.files]]
filename = "rust/lance-namespace/Cargo.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'
84 changes: 84 additions & 0 deletions .github/workflows/java-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,87 @@ jobs:
env:
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_TOKEN: ${{ secrets.SONATYPE_TOKEN }}

- name: Get published version
if: |
(github.event_name == 'release' && github.event.action == 'released') ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.mode == 'release')
id: get_version
run: |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Published version: $VERSION"

- name: Wait for Maven Central availability
if: |
(github.event_name == 'release' && github.event.action == 'released') ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.mode == 'release')
run: |
VERSION="${{ steps.get_version.outputs.version }}"
GROUP_ID="com.lancedb"

# List of some artifacts to check
ARTIFACTS=(
"lance-namespace-core"
"lance-namespace-apache-client"
)

echo "Waiting for version $VERSION to be available in Maven Central..."
echo "This typically takes 10-30 minutes after publishing to OSSRH."

# Maximum wait time: 60 minutes
MAX_WAIT=3600
INTERVAL=60
ELAPSED=0

while [ $ELAPSED -lt $MAX_WAIT ]; do
ALL_AVAILABLE=true

for ARTIFACT_ID in "${ARTIFACTS[@]}"; do
URL="https://repo1.maven.org/maven2/com/lancedb/${ARTIFACT_ID}/${VERSION}/${ARTIFACT_ID}-${VERSION}.pom"

if curl --head --silent --fail "$URL" > /dev/null 2>&1; then
echo "✓ ${ARTIFACT_ID} is available"
else
echo "✗ ${ARTIFACT_ID} is not yet available"
ALL_AVAILABLE=false
fi
done

if [ "$ALL_AVAILABLE" = true ]; then
echo ""
echo "🎉 All artifacts are now available in Maven Central!"
echo ""
echo "Users can now add the following dependencies to their projects:"
echo ""
echo "Maven:"
echo "<dependency>"
echo " <groupId>com.lancedb</groupId>"
echo " <artifactId>lance-namespace-core</artifactId>"
echo " <version>${VERSION}</version>"
echo "</dependency>"
echo ""
echo "Gradle:"
echo "implementation 'com.lancedb:lance-namespace-core:${VERSION}'"
echo ""
echo "SBT:"
echo "libraryDependencies += \"com.lancedb\" % \"lance-namespace-core\" % \"${VERSION}\""
exit 0
fi

ELAPSED=$((ELAPSED + INTERVAL))

if [ $ELAPSED -lt $MAX_WAIT ]; then
echo ""
echo "Artifacts not yet available. Waiting ${INTERVAL} seconds... (${ELAPSED}s elapsed)"
sleep $INTERVAL
fi
done

echo ""
echo "⚠️ WARNING: Artifacts are not yet available in Maven Central after ${MAX_WAIT} seconds."
echo "This is normal - Maven Central sync can take up to 2 hours."
echo "The artifacts will appear at: https://central.sonatype.com/artifact/com.lancedb/lance-namespace-core/${VERSION}"
echo ""
echo "You can check the sync status at: https://s01.oss.sonatype.org/"
exit 0
2 changes: 1 addition & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ jobs:
(github.event_name == 'release' && github.event.action == 'released') ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.mode == 'release')
run: |
uv publish --trusted-publishing always
uv publish --trusted-publishing always
191 changes: 191 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
name: Create Release

on:
workflow_dispatch:
inputs:
release_type:
description: 'Release type'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major
release_channel:
description: 'Release channel'
required: true
default: 'preview'
type: choice
options:
- preview
- stable
dry_run:
description: 'Dry run (simulate the release without pushing)'
required: true
default: true
type: boolean

jobs:
create-release:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag_name.outputs.tag }}
version: ${{ steps.new_version.outputs.version }}
steps:
- name: Output Inputs
run: echo "${{ toJSON(github.event.inputs) }}"

- name: Checkout repository
uses: actions/checkout@v4
with:
ref: main
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
pip install packaging bump-my-version toml

- name: Get current version
id: current_version
run: |
CURRENT_VERSION=$(python -c "import toml; print(toml.load('.bumpversion.toml')['tool']['bumpversion']['current_version'])")
echo "version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
echo "Current version: $CURRENT_VERSION"

- name: Calculate new version
id: new_version
run: |
python ci/calculate_version.py \
--current "${{ steps.current_version.outputs.version }}" \
--type "${{ inputs.release_type }}" \
--channel "${{ inputs.release_channel }}"

- name: Determine tag name
id: tag_name
run: |
if [ "${{ inputs.release_channel }}" == "stable" ]; then
VERSION="${{ steps.new_version.outputs.version }}"
TAG="v${VERSION}"
else
# For preview releases, use current version with beta suffix
VERSION="${{ steps.current_version.outputs.version }}"
# Find the next beta number for current version
BETA_TAGS=$(git tag -l "v${VERSION}-beta.*" | sort -V)
if [ -z "$BETA_TAGS" ]; then
BETA_NUM=1
else
LAST_BETA=$(echo "$BETA_TAGS" | tail -n 1)
LAST_NUM=$(echo "$LAST_BETA" | sed "s/v${VERSION}-beta.//")
BETA_NUM=$((LAST_NUM + 1))
fi
TAG="v${VERSION}-beta.${BETA_NUM}"
fi

echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "Tag will be: $TAG"

- name: Install uv for code generation (stable releases only)
if: inputs.release_channel == 'stable'
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Install openapi-generator-cli (stable releases only)
if: inputs.release_channel == 'stable'
run: |
uv tool install openapi-generator-cli

- name: Update version (stable releases only)
if: inputs.release_channel == 'stable'
run: |
python ci/bump_version.py --version "${{ steps.new_version.outputs.version }}"

- name: Regenerate auto-generated code (stable releases only)
if: inputs.release_channel == 'stable'
run: |
make build

- name: Configure git identity
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'

- name: Create release commit (stable releases only)
if: inputs.release_channel == 'stable'
run: |
git add -A
git commit -m "chore: release version ${{ steps.new_version.outputs.version }}" || echo "No changes to commit"

- name: Create tag
run: |
git tag -a "${{ steps.tag_name.outputs.tag }}" -m "Release ${{ steps.tag_name.outputs.tag }}"

- name: Push changes (if not dry run)
if: ${{ !inputs.dry_run }}
run: |
if [ "${{ inputs.release_channel }}" == "stable" ]; then
# Push the commit for stable releases
git push origin main
fi
# Always push the tag
git push origin "${{ steps.tag_name.outputs.tag }}"

- name: Generate release notes
id: release_notes
if: ${{ !inputs.dry_run }}
run: |
python ci/generate_release_notes.py \
--tag "${{ steps.tag_name.outputs.tag }}" \
--repo "${{ github.repository }}" \
--token "${{ secrets.GITHUB_TOKEN }}"

- name: Create GitHub Release Draft (if not dry run)
if: ${{ !inputs.dry_run }}
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.tag_name.outputs.tag }}
name: ${{ steps.tag_name.outputs.tag }}
body_path: release_notes.md
draft: true
prerelease: ${{ inputs.release_channel == 'preview' }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Summary
run: |
echo "## Release Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **Release Type:** ${{ inputs.release_type }}" >> $GITHUB_STEP_SUMMARY
echo "- **Release Channel:** ${{ inputs.release_channel }}" >> $GITHUB_STEP_SUMMARY
echo "- **Current Version:** ${{ steps.current_version.outputs.version }}" >> $GITHUB_STEP_SUMMARY
if [ "${{ inputs.release_channel }}" == "stable" ]; then
echo "- **New Version:** ${{ steps.new_version.outputs.version }}" >> $GITHUB_STEP_SUMMARY
fi
echo "- **Tag:** ${{ steps.tag_name.outputs.tag }}" >> $GITHUB_STEP_SUMMARY
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 "📝 Draft release created successfully!" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Next Steps:" >> $GITHUB_STEP_SUMMARY
echo "1. Review the draft release on the [releases page](https://github.com/${{ github.repository }}/releases)" >> $GITHUB_STEP_SUMMARY
echo "2. Edit the release notes if needed" >> $GITHUB_STEP_SUMMARY
echo "3. Publish the release to:" >> $GITHUB_STEP_SUMMARY
if [ "${{ inputs.release_channel }}" == "stable" ]; then
echo " - Create the official release" >> $GITHUB_STEP_SUMMARY
echo " - Trigger automatic publishing to Maven Central and PyPI" >> $GITHUB_STEP_SUMMARY
else
echo " - Create a preview/beta release" >> $GITHUB_STEP_SUMMARY
echo " - Note: Preview releases are not published to package repositories" >> $GITHUB_STEP_SUMMARY
fi
fi
Loading
Loading