11name : Bump version
2- # For the time being, we still do this with pdm.
3- # Honestly, it doesn't really matter,
4- # but one day uv will have a bump command too and we can switch to that.
5- # Relevant issue in uv: https://github.com/astral-sh/uv/issues/6298
62
73on :
84 workflow_dispatch :
95 inputs :
106 bump_rule :
117 type : choice
12- description : How to bump the project's version (see https://github.com/carstencodes/pdm-bump#usage )
8+ description : How to bump the project's version (see https://docs.astral.sh/uv/reference/cli/#uv-version )
139 options :
14- - no-pre-release
15- # no micro because we always sit on a pre-release in main,
16- # so we would always use no-pre-release instead of micro
17- # - micro
10+ - patch
1811 - minor
1912 - major
20- - " pre-release --pre alpha"
21- - " pre-release --pre beta"
22- - " pre-release --pre release-candidate"
13+ - stable
14+ - alpha
15+ - beta
16+ - rc
17+ - post
18+ - dev
2319 required : true
2420
2521jobs :
2925 strategy :
3026 matrix :
3127 os : [ "ubuntu-latest" ]
32- python-version : [ "3.9 " ]
28+ python-version : [ "3.11 " ]
3329 runs-on : " ${{ matrix.os }}"
3430 env :
3531 CI_COMMIT_EMAIL : " ci-runner@cmip-branded-variable-mapper.invalid"
4036 fetch-depth : 0
4137 token : " ${{ secrets.PERSONAL_ACCESS_TOKEN }}"
4238
43- - name : Setup PDM
44- uses : pdm-project/setup-pdm@v4.1
45- with :
46- python-version : ${{ matrix.python-version }}
47-
48- - name : Install pdm-bump
49- run : |
50- pdm self add pdm-bump
51-
5239 - uses : ./.github/actions/setup
5340 with :
5441 python-version : ${{ matrix.python-version }}
@@ -59,13 +46,13 @@ jobs:
5946 git config --global user.name "$GITHUB_ACTOR"
6047 git config --global user.email "$CI_COMMIT_EMAIL"
6148
62- BASE_VERSION=`sed -ne 's/^version = "\([0-9\.a ]*\)"/\1/p' pyproject.toml`
49+ BASE_VERSION=`sed -ne 's/^version = "\([0-9\.post ]*\)"/\1/p' pyproject.toml`
6350 echo "Bumping from version $BASE_VERSION"
6451
6552 # Bump
66- pdm bump ${{ github.event.inputs.bump_rule }}
53+ uv version -- bump ${{ github.event.inputs.bump_rule }}
6754
68- NEW_VERSION=`sed -ne 's/^version = "\([0-9\.a ]*\)"/\1/p' pyproject.toml`
55+ NEW_VERSION=`sed -ne 's/^version = "\([0-9\.]*\)"/\1/p' pyproject.toml`
6956 echo "Bumping to version $NEW_VERSION"
7057
7158 # Build CHANGELOG
@@ -78,12 +65,12 @@ jobs:
7865
7966 # Bump to alpha (so that future commits do not have the same
8067 # version as the tagged commit)
81- BASE_VERSION=`sed -ne 's/^version = "\([0-9\.a ]*\)"/\1/p' pyproject.toml`
68+ BASE_VERSION=`sed -ne 's/^version = "\([0-9\.]*\)"/\1/p' pyproject.toml`
8269
8370 # Bump to pre-release of next version
84- pdm bump pre-release --pre alpha
71+ uv version --bump post
8572
86- NEW_VERSION=`sed -ne 's/^version = "\([0-9\.a ]*\)"/\1/p' pyproject.toml`
73+ NEW_VERSION=`sed -ne 's/^version = "\([0-9\.post ]*\)"/\1/p' pyproject.toml`
8774 echo "Bumping version $BASE_VERSION > $NEW_VERSION"
8875
8976 # Commit and push
0 commit comments