bump-python-sdk-version #3
This file contains 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: bump-python-sdk-version | |
# This workflow is used to bump the version of the Weave Python SDK. | |
# It will take 2 steps: | |
# 1. Drop the pre-release tag and push a new commit to the main branch. | |
# 2. Bump the version to the next pre-release version and push a new commit to the main branch. | |
# | |
# see weave/version.py for more details on the versioning scheme. | |
on: | |
workflow_dispatch: | |
inputs: | |
bump_type: | |
description: "Version bump type (major, minor, patch)" | |
required: true | |
default: "patch" | |
options: | |
- "patch" | |
- "minor" | |
- "major" | |
jobs: | |
build-assets: | |
name: Bump Python SDK Version | |
runs-on: ubuntu-8core | |
timeout-minutes: 10 | |
environment: | |
name: release | |
permissions: | |
contents: "write" | |
id-token: "write" | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.WANDBMACHINE_GITHUB_TOKEN }} | |
fetch-depth: 0 | |
- id: setup_git | |
run: | | |
git config --global user.name 'Weave Build Bot' | |
git config --global user.email [email protected] | |
- id: install_bump | |
run: pip install --upgrade bump-my-version | |
- id: bump_version | |
run: | | |
bump-my-version bump ${{ github.event.inputs.bump_type }} ./weave/version.py --tag --commit | |
git push | |
git push --tags | |
- id: start_next_development_cycle | |
# This might seem weird to bump patch and then pre_n, but since semver | |
# dictates that pre-release versions have lower precedence, this ensures | |
# that the next commit on main will have a pre-release version. | |
run: | | |
bump-my-version bump patch ./weave/version.py | |
bump-my-version bump pre_n ./weave/version.py --commit | |
git push | |
git push --tags |