CI: use dunamai for version
This commit is contained in:
parent
b465394766
commit
f4b38e1c69
1 changed files with 11 additions and 14 deletions
|
@ -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: |
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue