-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Setup automated semver bumps (#2118)
* bump init * bump init * bump more config * bump more config * bump more config * more comments * init * init * init * init * update patcher * update patcher * testing * testing * testing * prep for merge * prep for merge
- Loading branch information
Showing
4 changed files
with
136 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
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: Build frontend assets | ||
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: "Bump the version" | ||
run: | | ||
bump-my-version bump ${{ github.event.inputs.bump_type }} ./weave/version.py --tag --commit | ||
git push | ||
git push --tags | ||
- id: "Start the 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 |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,4 @@ build | |
twine | ||
lazydocs | ||
nbconvert | ||
bump-my-version |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,47 @@ | ||
VERSION = "0.51.2" | ||
"""Contains the version of the Weave SDK. | ||
This version is used by pyproject.toml to specify the version of the Weave SDK and | ||
imported by the library for runtime access. It must be kept in sync with pyproject.toml, | ||
specifically the [tool.bumpversion] section: | ||
``` | ||
[tool.bumpversion] | ||
current_version = "M.m.p-dev0" | ||
``` | ||
We use Semantic Versioning (https://semver.org/). The version number is in the format | ||
MAJOR.MINOR.PATCH[-PRERELEASE]. | ||
- MAJOR version when you make incompatible API changes, | ||
- MINOR version when you add functionality in a backwards compatible manner, and | ||
- PATCH version when you make backwards compatible bug fixes. | ||
For the most part, we are incrementing PATCH until we complete the core functionality. | ||
As specified by Semantic Versioning, the PRERELEASE version is optional and can be | ||
appended to the PATCH version. Specifically: | ||
``` | ||
When major, minor, and patch are equal, a pre-release version has lower precedence than a normal version: | ||
Example: 1.0.0-alpha < 1.0.0. | ||
``` | ||
The intention is to have a PRERELEASE version of the form of `dev0` for nearly every commit | ||
on the main branch. However, the released commit will not have a PRERELEASE version. For example: | ||
* Development happens on X.Y.Z-dev0 | ||
* Release commit bumps the version to >=X.Y.Z, noted X'.Y'.Z', tagging such commit | ||
* Development continues on (>X.Y.Z)-dev0. | ||
* Note: if X' == X, Y' == Y, and Z' == Z, then the version is bumped to X'.Y'.(Z'+1)-dev0. Else, the version is bumped to X'.Y'.Z'-dev0. | ||
This is all facilitated using `make bumpversion` which is a wrapper around `bump-my-version`. | ||
Please see the `bump-my-version` documentation for more information: | ||
https://github.com/callowayproject/bump-my-version. Additional configuration can be found in | ||
`pyproject.toml`. | ||
""" | ||
|
||
VERSION = "0.51.2-dev1" |