Skip to content

bump-python-sdk-version #6209

bump-python-sdk-version

bump-python-sdk-version #6209

Workflow file for this run

name: bump-python-sdk-version
# This workflow is used to bump the version of the Weave Python SDK.
# It will take 2 steps (3 for a minor/major release, which first moves the dev base):
# 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: "Semver segment to release"
required: true
type: choice
options:
- patch
- minor
- major
default: patch
jobs:
build-assets:
name: Bump and Tag Python SDK Version
runs-on: ubuntu-8core
timeout-minutes: 10
environment:
name: release
permissions:
contents: "write"
id-token: "write"
steps:
- name: Create GitHub App token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3
with:
app-id: ${{ vars.WANDBOT_3000_APP_ID }}
private-key: ${{ secrets.WANDBOT_3000_PRIVATE_KEY }}
owner: wandb
repositories: weave
permission-contents: write
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
token: ${{ steps.app-token.outputs.token }}
fetch-depth: 0
- id: setup_git
run: |
git config --global user.name 'Weave Build Bot'
git config --global user.email weave@wandb.com
- id: install_bump
run: pip install --upgrade bump-my-version
- id: bump_release_segment
# For minor/major, first move the dev base onto the new segment
# (e.g. X.Y.Z-dev0 -> X.(Y+1).0-dev0) before dropping the pre-release tag.
if: inputs.bump_type != 'patch'
run: |
bump-my-version bump ${{ inputs.bump_type }} ./weave/version.py --commit
- id: drop_pre_release
# First we drop the pre-release tag since X.Y.Z-dev0 has lower precedence than X.Y.Z
# This is the commit we will release from
run: |
bump-my-version bump pre_l ./weave/version.py --tag --commit
- id: bump_version_and_add_pre_release
# Next we bump the version to the next pre-release version. Effectively
# starting the next development cycle. X.Y.Z -> X.Y.(Z + 1)-dev0
run: |
bump-my-version bump patch ./weave/version.py --commit
- id: push_changes
run: |
git push
git push --tags