name: Create release commit # This workflow increments versions, tags the version, and pushes it. # When a tag is pushed, another workflow is triggered that creates a GH release # and uploads the binaries. This workflow is only for creating the tag. # This script will enforce that a minor version is incremented if there are any # breaking changes since the last minor increment. However, it isn't able to # differentiate between breaking changes in Node versus Python. If you wish to # bypass this check, you can manually increment the version and push the tag. on: workflow_dispatch: inputs: dry_run: description: 'Dry run (create the local commit/tags but do not push it)' required: true default: false type: boolean type: description: 'What kind of release is this?' required: true default: 'preview' type: choice options: - preview - stable python: description: 'Make a Python release' required: true default: true type: boolean other: description: 'Make a Node/Rust/Java release' required: true default: true type: boolean bump-minor: description: 'Bump minor version' required: true default: false type: boolean jobs: make-release: # Creates tag and GH release. The GH release will trigger the build and release jobs. runs-on: ubuntu-latest permissions: contents: write steps: - name: Output Inputs run: echo "${{ toJSON(github.event.inputs) }}" - uses: actions/checkout@v4 with: fetch-depth: 0 lfs: true # It's important we use our token here, as the default token will NOT # trigger any workflows watching for new tags. See: # https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow token: ${{ secrets.LANCEDB_RELEASE_TOKEN }} - name: Set git configs for bumpversion shell: bash run: | git config user.name 'Lance Release' git config user.email 'lance-dev@lancedb.com' - name: Set up Python 3.11 uses: actions/setup-python@v5 with: python-version: "3.11" - name: Bump Python version if: ${{ inputs.python }} working-directory: python env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | # Need to get the commit before bumping the version, so we can # determine if there are breaking changes in the next step as well. echo "COMMIT_BEFORE_BUMP=$(git rev-parse HEAD)" >> $GITHUB_ENV pip install bump-my-version PyGithub packaging bash ../ci/bump_version.sh ${{ inputs.type }} ${{ inputs.bump-minor }} python-v - name: Bump Node/Rust version if: ${{ inputs.other }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | pip install bump-my-version PyGithub packaging bash ci/bump_version.sh ${{ inputs.type }} ${{ inputs.bump-minor }} v $COMMIT_BEFORE_BUMP - name: Push new version tag if: ${{ !inputs.dry_run }} uses: ad-m/github-push-action@master with: # Need to use PAT here too to trigger next workflow. See comment above. github_token: ${{ secrets.LANCEDB_RELEASE_TOKEN }} branch: ${{ github.ref }} tags: true - uses: ./.github/workflows/update_package_lock if: ${{ !inputs.dry_run && inputs.other }} with: github_token: ${{ secrets.GITHUB_TOKEN }}