Skip to content

Commit 5a7fb9a

Browse files
authored
ci: test dockerimage with more unique version identifier (#453)
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent bf133a3 commit 5a7fb9a

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

.github/workflows/docker.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ jobs:
3030
fetch-depth: 0
3131
- name: setup reports-dir
3232
run: mkdir "$REPORTS_DIR"
33-
3433
- name: Setup python ${{ env.PYTHON_VERISON }}
3534
# see https://github.com/actions/setup-python
3635
uses: actions/setup-python@v4
@@ -41,7 +40,12 @@ jobs:
4140
uses: Gr1N/setup-poetry@v7
4241
with:
4342
poetry-version: ${{ env.POETRY_VERSION }}
44-
43+
- name: bump version
44+
id: bump-version
45+
run: |
46+
VERSION="${{ github.run_id }}.${{ github.run_number }}.${{ github.run_attempt }}+testing"
47+
poetry version "$VERSION"
48+
echo "version=$VERSION" >> $GITHUB_OUTPUT
4549
- name: Poetry build
4650
run: poetry build
4751
- name: Artifact python dist
@@ -54,22 +58,14 @@ jobs:
5458
name: ${{ env.RUN_ARTIFACT_PYTHON_DIST }}
5559
path: ${{ env.DIST_SOURCE_DIR }}/
5660
if-no-files-found: warn
57-
58-
- name: post-hook
59-
id: after-build
60-
run: |
61-
VERSION="$(poetry version --short --no-interaction --no-ansi)"
62-
echo "version=$VERSION" >> $GITHUB_OUTPUT
63-
6461
- name: Build Docker image
6562
env:
66-
VERSION: ${{ steps.after-build.outputs.version }}
63+
VERSION: ${{ steps.bump-version.outputs.version }}
6764
run: >
6865
docker build -f Dockerfile
6966
--build-arg "VERSION=$VERSION"
7067
-t "$DOCKER_TAG"
7168
.
72-
7369
- name: Build own SBoM (XML)
7470
run: >
7571
docker run --rm "$DOCKER_TAG"
@@ -92,7 +88,6 @@ jobs:
9288
name: ${{ env.REPORTS_ARTIFACT }}
9389
path: ${{ env.REPORTS_DIR }}
9490
if-no-files-found: error
95-
9691
- name: Destroy Docker image
9792
# run regardless of outcome
9893
if: ${{ always() }}

0 commit comments

Comments
 (0)