CI: use dunamai for version
Some checks failed
/ build (push) Failing after 2s
/ test (push) Failing after 1s

This commit is contained in:
phil 2025-02-25 02:20:35 +01:00
parent b465394766
commit f4b38e1c69

View file

@ -30,32 +30,29 @@ jobs:
- name: Get version
uses: mtkennerly/dunamai-action@v1
with:
env-var: VERSION
args: --style semver
env-var: VERSION
- name: Version
run: echo $VERSION
- name: Get version with git describe
id: version
run: |
echo "version=$(git describe)" >> $GITHUB_OUTPUT
echo "$VERSION"
- name: Get distance from tag
uses: mtkennerly/dunamai-action@v1
with:
args: --format "{distance}"
env-var: DISTANCE
- name: Check if the container should be built
- name: Distance
run: echo $DISTANCE
- name: Check if the container should be built (distance from git tag is 0, or force build)
id: builder
env:
RUN: ${{ toJSON(inputs.build || !contains(steps.version.outputs.version, '-')) }}
RUN: ${{ toJSON(inputs.build || env.DISTANCE == "0" }}
run: |
echo "run=$RUN" >> $GITHUB_OUTPUT
echo "Run build: $RUN"
- name: Set the version in pyproject.toml (workaround for uv not supporting dynamic version)
if: fromJSON(steps.builder.outputs.run)
env:
VERSION: ${{ steps.version.outputs.version }}
run: sed "s/0.0.0/$VERSION/" -i pyproject.toml
- name: Workaround for bug of podman-login
if: fromJSON(steps.builder.outputs.run)
run: |