ci!: move to semantic versioning release mechanism #10
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Create RC on Release Branch | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| release_branch: | ||
| description: 'Release branch (e.g., release/v1.3)' | ||
| required: true | ||
| type: string | ||
| dry_run: | ||
| description: 'Dry run (simulate without pushing)' | ||
| required: true | ||
| default: false | ||
| type: boolean | ||
| jobs: | ||
| create-rc: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| rc_version: ${{ steps.create.outputs.RC_VERSION }} | ||
| rc_tag: ${{ steps.create.outputs.RC_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: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: "3.11" | ||
| - name: Install dependencies | ||
| 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 | ||
| run: | | ||
| git config user.name 'Lance Release Bot' | ||
| git config user.email 'lance-dev@lancedb.com' | ||
| - name: Create RC | ||
| id: create | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| GITHUB_REPOSITORY: ${{ github.repository }} | ||
| GITHUB_OUTPUT: ${{ github.output }} | ||
| run: | | ||
| bash ci/create_rc.sh "${{ inputs.release_branch }}" | ||
| - name: Create GitHub Discussion for voting | ||
| if: ${{ !inputs.dry_run }} | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.LANCE_RELEASE_TOKEN }} | ||
| run: | | ||
| python3 << 'EOF' | ||
| import os | ||
| import json | ||
| from github import Github | ||
| g = Github(os.environ['GITHUB_TOKEN']) | ||
| repo = g.get_repo(os.environ['GITHUB_REPOSITORY']) | ||
| rc_tag = "${{ steps.create.outputs.RC_TAG }}" | ||
| rc_version = "${{ steps.create.outputs.RC_VERSION }}" | ||
| # Try to find "Releases" category, fall back to "General" | ||
| categories = list(repo.get_discussion_categories()) | ||
| category = next((c for c in categories if c.name == "Releases"), None) | ||
| if not category: | ||
| category = next((c for c in categories if c.name == "General"), categories[0]) | ||
| title = f"Vote: Release Candidate {rc_tag}" | ||
| body = f"""# Release Candidate {rc_tag} | ||
| A new release candidate has been created and is ready for voting. | ||
| ## Testing Instructions | ||
| 1. **Python** (fury.io): | ||
| ```bash | ||
| pip install --extra-index-url https://pypi.fury.io/lancedb/ pylance=={rc_version} | ||
| ``` | ||
| 2. **Java** (Maven Central - pre-release) | ||
| 3. **Rust** (use git tag reference) | ||
| ## Voting | ||
| Please test the RC and vote by commenting: | ||
| - **+1** to approve | ||
| - **0** to abstain or neutral | ||
| - **-1** if issues found (please include details) | ||
| ## Timeline | ||
| Voting period: TBD (coordinate with project maintainers) | ||
| """ | ||
| discussion = repo.create_discussion( | ||
| title=title, | ||
| body=body, | ||
| category=category | ||
| ) | ||
| print(f"Created discussion: {discussion.html_url}") | ||
| print(f"DISCUSSION_URL={discussion.html_url}") | ||
| EOF | ||
| - name: Push changes (if not dry run) | ||
| if: ${{ !inputs.dry_run }} | ||
| run: | | ||
| git push origin "${{ inputs.release_branch }}" | ||
| git push origin "${{ steps.create.outputs.RC_TAG }}" | ||
| - name: Summary | ||
| run: | | ||
| echo "## RC Creation Summary" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "- **Release Branch:** ${{ inputs.release_branch }}" >> $GITHUB_STEP_SUMMARY | ||
| echo "- **RC Version:** ${{ steps.create.outputs.RC_VERSION }}" >> $GITHUB_STEP_SUMMARY | ||
| echo "- **RC Tag:** ${{ steps.create.outputs.RC_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 "✅ RC ${{ steps.create.outputs.RC_TAG }} created!" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "**Next steps:**" >> $GITHUB_STEP_SUMMARY | ||
| echo "1. Check the GitHub Discussion thread for voting" >> $GITHUB_STEP_SUMMARY | ||
| echo "2. Test RC artifacts" >> $GITHUB_STEP_SUMMARY | ||
| echo "3. Vote on the RC" >> $GITHUB_STEP_SUMMARY | ||
| echo "4. If approved, promote to stable" >> $GITHUB_STEP_SUMMARY | ||
| fi | ||