Skip to content

Commit 2872e42

Browse files
authored
Merge pull request #141 from SAP/fix/ci
feat: upgrade-test pass version properly between steps
2 parents e342b6b + d7a03a9 commit 2872e42

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

.github/workflows/upgrade-test.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ on:
2020
jobs:
2121
# if the target is not set, we want to take the latest git commit of the branch and build the image with that.
2222
build-test-version:
23-
if: ${{ github.event.inputs.target == '' }}
23+
if: ${{ github.event.inputs.target == '' }}
24+
outputs:
25+
target_version: ${{ steps.set-target-version.outputs.BUILD_IMAGE_VERSION }}
2426
runs-on: ubuntu-latest
2527
steps:
2628
- name: Setup Docker Buildx
@@ -44,9 +46,17 @@ jobs:
4446
run: make vendor vendor.check
4547

4648
- name: Set up Version
49+
id: set-target-version
4750
run: |
51+
echo "setting version to v0.0.0-draft-${{ github.sha }}"
4852
echo "BUILD_IMAGE_VERSION=v0.0.0-draft-${{ github.sha }}" >> $GITHUB_ENV
49-
echo "version is $BUILD_IMAGE_VERSION"
53+
echo "BUILD_IMAGE_VERSION=v0.0.0-draft-${{ github.sha }}" >> $GITHUB_OUTPUT
54+
55+
- name: Print Version Number
56+
run: |
57+
echo "BUILD_IMAGE_VERSION is $BUILD_IMAGE_VERSION"
58+
59+
5060
- name: Build Images
5161
run: make build VERSION=$BUILD_IMAGE_VERSION
5262
env:
@@ -78,11 +88,15 @@ jobs:
7888
- name: Set TARGET_IMAGE_VERSION
7989
run: |
8090
if [ -z "${{ github.event.inputs.target }}" ]; then
81-
echo "TARGET_IMAGE_VERSION=$BUILD_IMAGE_VERSION" >> $GITHUB_ENV
91+
echo "TARGET_IMAGE_VERSION=${{ needs.build-test-version.outputs.target_version }}" >> $GITHUB_ENV
8292
else
8393
echo "TARGET_IMAGE_VERSION=${{ github.event.inputs.target }}" >> $GITHUB_ENV
8494
fi
8595
96+
- name: Print TARGET_IMAGE_VERSION
97+
run: |
98+
echo "TARGET_IMAGE_VERSION is $TARGET_IMAGE_VERSION"
99+
86100
- name: Clone provider-upgrade-test repo
87101
run: |
88102
git clone https://github.com/openmcp-project/provider-upgrade-test.git

0 commit comments

Comments
 (0)