Skip to content

Commit 723901b

Browse files
committed
wip: add dynamic version and fix warnings
1 parent 6d434a4 commit 723901b

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

.github/workflows/publish-cli-to-testpypi.yaml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@ jobs:
2222
- name: Install build dependencies
2323
run: python -m pip install build --user
2424

25+
- name: Bump version for TestPyPI
26+
working-directory: cli/casp
27+
run: |
28+
# Get the latest tag and strip the leading 'v' (e.g., v1.0.0 -> 1.0.0)
29+
LAST_TAG=$(git describe --tags --abbrev=0)
30+
VERSION=${LAST_TAG#v}
31+
TIMESTAMP=$(date +%s)
32+
33+
# Set version to <last_tag>.<timestamp> (e.g., 1.0.0.1701234567)
34+
sed -i "s/^version = \".*\"/version = \"$VERSION.$TIMESTAMP\"/" pyproject.toml
35+
2536
- name: Build package
2637
working-directory: cli/casp
2738
run: python -m build
@@ -31,5 +42,5 @@ jobs:
3142
with:
3243
password: ${{ secrets.TEST_CASP_PYPI_API_TOKEN }}
3344
repository-url: https://test.pypi.org/legacy/
34-
packages_dir: cli/casp/dist/
35-
skip_existing: true
45+
packages-dir: cli/casp/dist/
46+
skip-existing: true

0 commit comments

Comments
 (0)