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
29 changes: 29 additions & 0 deletions .bumpversion.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[tool.bumpversion]
current_version = "0.0.1"
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}"

# pyproject.toml - project version
[[tool.bumpversion.files]]
filename = "pyproject.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'

# lance_ray/__init__.py - package version (if exists)
[[tool.bumpversion.files]]
filename = "lance_ray/__init__.py"
search = '__version__ = "{current_version}"'
replace = '__version__ = "{new_version}"'
ignore_missing_files = true
36 changes: 36 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

changelog:
exclude:
labels:
- ci
- chore
categories:
- title: Breaking Changes 🛠
labels:
- breaking-change
- title: New Features 🎉
labels:
- enhancement
- title: Bug Fixes 🐛
labels:
- bug
- title: Documentation 📚
labels:
- documentation
- title: Performance Improvements 🚀
labels:
- performance
- title: Other Changes
labels:
- "*"
189 changes: 189 additions & 0 deletions .github/workflows/auto-bump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
name: Auto Bump Version

on:
workflow_dispatch:
inputs:
bump_type:
description: 'Type of version bump'
required: false
default: 'auto'
type: choice
options:
- auto
- patch
- minor
- major

jobs:
check-for-changes:
runs-on: ubuntu-latest
outputs:
should_bump: ${{ steps.check.outputs.should_bump }}
bump_type: ${{ steps.check.outputs.bump_type }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Check for unreleased changes
id: check
run: |
# Get the last tag
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")

if [ -z "$LAST_TAG" ]; then
echo "No tags found, should create initial release"
echo "should_bump=true" >> $GITHUB_OUTPUT
echo "bump_type=patch" >> $GITHUB_OUTPUT
exit 0
fi

# Check for commits since last tag
COMMITS_SINCE_TAG=$(git rev-list --count ${LAST_TAG}..HEAD)

if [ "$COMMITS_SINCE_TAG" -gt 0 ]; then
echo "Found $COMMITS_SINCE_TAG commits since last tag $LAST_TAG"

# Determine bump type based on input or commit analysis
if [ "${{ inputs.bump_type }}" != "auto" ] && [ -n "${{ inputs.bump_type }}" ]; then
# Use manual input if provided and not "auto"
BUMP_TYPE="${{ inputs.bump_type }}"
else
# Analyze commit messages to determine bump type
BUMP_TYPE="patch"

# Check for breaking changes (major bump)
if git log ${LAST_TAG}..HEAD --grep="BREAKING CHANGE" --grep="!:" | grep -q .; then
BUMP_TYPE="major"
# Check for features (minor bump)
elif git log ${LAST_TAG}..HEAD --grep="^feat" --grep="^feature" | grep -q .; then
BUMP_TYPE="minor"
fi
fi

echo "should_bump=true" >> $GITHUB_OUTPUT
echo "bump_type=$BUMP_TYPE" >> $GITHUB_OUTPUT
else
echo "No commits since last tag $LAST_TAG"
echo "should_bump=false" >> $GITHUB_OUTPUT
fi

- name: Summary
run: |
echo "## Auto Bump Check" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ "${{ steps.check.outputs.should_bump }}" == "true" ]; then
echo "✅ Version bump needed" >> $GITHUB_STEP_SUMMARY
echo "- **Bump Type:** ${{ steps.check.outputs.bump_type }}" >> $GITHUB_STEP_SUMMARY
else
echo "⏭️ No version bump needed" >> $GITHUB_STEP_SUMMARY
fi

create-bump-pr:
needs: check-for-changes
if: needs.check-for-changes.outputs.should_bump == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
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 toml bump-my-version

- name: Get current version
id: current_version
run: |
CURRENT_VERSION=$(python -c "import toml; print(toml.load('pyproject.toml')['project']['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 "${{ needs.check-for-changes.outputs.bump_type }}" \
--channel "stable"

- name: Create feature branch
run: |
BRANCH_NAME="auto-bump-${{ steps.new_version.outputs.version }}"
git checkout -b $BRANCH_NAME
echo "branch=$BRANCH_NAME" >> $GITHUB_ENV

- name: Bump version
run: |
python ci/bump_version.py --version "${{ steps.new_version.outputs.version }}"

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

- name: Commit changes
run: |
git add -A
git commit -m "chore: bump version to ${{ steps.new_version.outputs.version }}

Automated version bump from ${{ steps.current_version.outputs.version }} to ${{ steps.new_version.outputs.version }}.
Bump type: ${{ needs.check-for-changes.outputs.bump_type }}"

- name: Push changes
run: |
git push origin ${{ env.branch }}

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ env.branch }}
base: main
title: "chore: bump version to ${{ steps.new_version.outputs.version }}"
body: |
## Automated Version Bump

This PR automatically bumps the version from `${{ steps.current_version.outputs.version }}` to `${{ steps.new_version.outputs.version }}`.

### Details
- **Bump Type:** ${{ needs.check-for-changes.outputs.bump_type }}
- **Triggered By:** ${{ github.event_name == 'workflow_dispatch' && 'Manual trigger' || 'Automated' }}

### Checklist
- [ ] Review version bump changes
- [ ] Verify pyproject.toml is updated
- [ ] Confirm CI checks pass

### Next Steps
After merging this PR, you can create a release by:
1. Going to Actions → Create Release workflow
2. Selecting the release channel (stable/preview)
3. Running the workflow

---
*This PR was automatically generated by the auto-bump workflow.*
labels: |
version-bump
automated
assignees: ${{ github.actor }}

- name: Summary
run: |
echo "## Version Bump PR Created" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **Current Version:** ${{ steps.current_version.outputs.version }}" >> $GITHUB_STEP_SUMMARY
echo "- **New Version:** ${{ steps.new_version.outputs.version }}" >> $GITHUB_STEP_SUMMARY
echo "- **Bump Type:** ${{ needs.check-for-changes.outputs.bump_type }}" >> $GITHUB_STEP_SUMMARY
echo "- **Branch:** ${{ env.branch }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "✅ Pull request created successfully!" >> $GITHUB_STEP_SUMMARY
18 changes: 17 additions & 1 deletion .github/workflows/python-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ on:
options:
- dry_run
- release
ref:
description: 'The branch, tag or SHA to checkout'
required: false
type: string

jobs:
publish:
Expand All @@ -39,6 +43,10 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# When triggered by a release, use the release tag
# When triggered manually, use the provided ref
ref: ${{ github.event.release.tag_name || inputs.ref }}

- name: Set up Python
uses: actions/setup-python@v5
Expand All @@ -52,9 +60,17 @@ jobs:
run: |
uv build

- name: Get package version
id: get_version
run: |
VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Package version: $VERSION"

- name: Publish to PyPI
if: |
(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
echo "✅ Successfully published version ${{ steps.get_version.outputs.version }} to PyPI!"
Loading