Skip to content

Commit

Permalink
#11 💚 support automatic dev versioning for ci builds
Browse files Browse the repository at this point in the history
  • Loading branch information
d-ryan-ashcraft committed Jan 21, 2025
1 parent bca630d commit 343afe7
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 2 deletions.
39 changes: 39 additions & 0 deletions .bumpversion.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[tool.bumpversion]
current_version = "0.1.7-dev5"
parse = """(?x)
(?P<major>0|[1-9]\\d*)\\.
(?P<minor>0|[1-9]\\d*)\\.
(?P<patch>0|[1-9]\\d*)
(?:
- # dash separator for pre-release section
(?P<pre_l>[a-zA-Z-]+) # pre-release label
(?P<pre_n>0|[1-9]\\d*) # pre-release version number
)? # pre-release section is optional
"""
serialize = [
"{major}.{minor}.{patch}-{pre_l}{pre_n}",
"{major}.{minor}.{patch}",
]
search = "{current_version}"
replace = "{new_version}"
regex = false
ignore_missing_version = false
ignore_missing_files = false
tag = false
sign_tags = false
tag_name = "v{new_version}"
tag_message = "Bump version: {current_version} → {new_version}"
allow_dirty = false
commit = true
message = ":memo: Bump version: {current_version} → {new_version}"
commit_args = ""
setup_hooks = []
pre_commit_hooks = []
post_commit_hooks = []

[[tool.bumpversion.files]]
filename = "pyproject.toml"

[tool.bumpversion.parts.pre_l]
values = ["dev", "rc", "final"]
optional_value = "final"
14 changes: 14 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,22 @@ jobs:
run: |
uv build
- name: Publish
if: github.event.inputs.buildBranch == 'dev'
run: |
uv publish --publish-url https://test.pypi.org/legacy/ --token ${{ secrets.TEST_PYPI_TOKEN }}
- name: Bump version
if: github.event.inputs.buildBranch == 'dev'
id: bump
uses: callowayproject/bump-my-version@master
env:
PACKAGE: "true"
with:
args: "pre_n"
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check
if: steps.bump.outputs.bumped == 'true' && github.event.inputs.buildBranch == 'dev'
run: |
echo "Version was bumped from ${{ steps.bump.outputs.previous-version }} to ${{ steps.bump.outputs.current-version }}!"
- name: Upload pants log
uses: actions/upload-artifact@v4
with:
Expand Down
9 changes: 7 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "pants-uv-lifecycle-plugin"
version = "0.1.7-dev"
version = "0.1.7-dev5"
description = "The repository contains the Pantsbuild `uv` plugins."
readme = "README.md"
authors = [
Expand All @@ -12,4 +12,9 @@ dependencies = []

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
build-backend = "hatchling.build"

[dependency-groups]
dev = [
"bump-my-version>=0.29.0",
]

0 comments on commit 343afe7

Please sign in to comment.