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
|
- name: Get version
|
||||||
uses: mtkennerly/dunamai-action@v1
|
uses: mtkennerly/dunamai-action@v1
|
||||||
with:
|
with:
|
||||||
env-var: VERSION
|
|
||||||
args: --style semver
|
args: --style semver
|
||||||
|
env-var: VERSION
|
||||||
|
|
||||||
- name: Version
|
- name: Version
|
||||||
run: echo $VERSION
|
run: echo $VERSION
|
||||||
|
|
||||||
- name: Get version with git describe
|
- name: Get distance from tag
|
||||||
id: version
|
uses: mtkennerly/dunamai-action@v1
|
||||||
run: |
|
with:
|
||||||
echo "version=$(git describe)" >> $GITHUB_OUTPUT
|
args: --format "{distance}"
|
||||||
echo "$VERSION"
|
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
|
id: builder
|
||||||
env:
|
env:
|
||||||
RUN: ${{ toJSON(inputs.build || !contains(steps.version.outputs.version, '-')) }}
|
RUN: ${{ toJSON(inputs.build || env.DISTANCE == "0" }}
|
||||||
run: |
|
run: |
|
||||||
echo "run=$RUN" >> $GITHUB_OUTPUT
|
echo "run=$RUN" >> $GITHUB_OUTPUT
|
||||||
echo "Run build: $RUN"
|
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
|
- name: Workaround for bug of podman-login
|
||||||
if: fromJSON(steps.builder.outputs.run)
|
if: fromJSON(steps.builder.outputs.run)
|
||||||
run: |
|
run: |
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue