Skip to content

Commit 83ef246

Browse files
authored
PYTHON-5711 Fix version bump handling (#28)
1 parent 1519694 commit 83ef246

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

.github/scripts/bump-version.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
set -eu
3+
4+
CURRENT_VERSION=$(
5+
grep -E '^[[:space:]]*version[[:space:]]*=' pyproject.toml \
6+
| head -n1 \
7+
| sed -E 's/.*version[[:space:]]*=[[:space:]]*"([^"]*)".*/\1/'
8+
)
9+
sed -i "s/version = \"${CURRENT_VERSION}\"/version = \"$1\"/" pyproject.toml

.github/workflows/release-python.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ env:
2020
# to 'false' when the input is set to 'false'.
2121
DRY_RUN: ${{ ! contains(inputs.dry_run, 'false') }}
2222
FOLLOWING_VERSION: ${{ inputs.following_version || '' }}
23+
VERSION: ${{ github.event_name == 'schedule' && '10.10.10.10' || '' }}
2324

2425
concurrency:
2526
group: release-${{ github.ref }}
@@ -52,6 +53,8 @@ jobs:
5253
- uses: mongodb-labs/drivers-github-tools/python-labs/pre-publish@v3
5354
id: pre-publish
5455
with:
56+
version: ${{ env.VERSION }}
57+
version_bump_script: ./.github/scripts/bump-version.sh
5558
dry_run: ${{ env.DRY_RUN }}
5659

5760
build-dist:
@@ -101,6 +104,8 @@ jobs:
101104
aws_secret_id: ${{ secrets.AWS_SECRET_ID }}
102105
- uses: mongodb-labs/drivers-github-tools/python-labs/post-publish@v3
103106
with:
107+
version: ${{ env.VERSION }}
108+
version_bump_script: ./.github/scripts/bump-version.sh
104109
following_version: ${{ env.FOLLOWING_VERSION }}
105110
product_name: ${{ env.PRODUCT_NAME }}
106111
token: ${{ github.token }}

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "django-mongodb-extensions"
7-
version = "0.1.0a0"
7+
version = "0.1.0a1"
88
description = "Extensions for Django MongoDB Backend"
99
readme = "README.md"
1010
license = { file="LICENSE" }

0 commit comments

Comments
 (0)