Skip to content

Commit 33f3a9f

Browse files
authored
Release workflow upload fixes (#5858)
1 parent 0fb7dde commit 33f3a9f

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

.github/workflows/build-oss.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,16 @@ jobs:
104104
env:
105105
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
106106

107-
- name: Check if base images exist
108-
id: base_exists
107+
- name: Set base name variable
108+
id: base_name
109109
run: |
110110
base_image="gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-base/oss:${{ inputs.base-image-md5 }}-${{ inputs.image }}"
111111
echo "image=${base_image}" >> $GITHUB_OUTPUT
112-
if docker manifest inspect ${base_image}; then
112+
113+
- name: Check if base images exist
114+
id: base_exists
115+
run: |
116+
if docker manifest inspect ${{ steps.base_name.outputs.image }}; then
113117
echo "exists=true" >> $GITHUB_OUTPUT
114118
fi
115119
if: ${{ inputs.authenticated && ! inputs.full-build }}
@@ -121,7 +125,7 @@ jobs:
121125
context: "."
122126
cache-to: type=gha,scope=${{ inputs.image }},mode=max
123127
target: common
124-
tags: ${{ steps.base_exists.outputs.image }}
128+
tags: ${{ steps.base_name.outputs.image }}
125129
platforms: ${{ inputs.platforms }}
126130
pull: true
127131
push: true
@@ -175,7 +179,7 @@ jobs:
175179
provenance: false
176180
build-args: |
177181
BUILD_OS=${{ inputs.image }}
178-
${{ inputs.authenticated && format('PREBUILT_BASE_IMG={0}', steps.base_exists.outputs.image) }}
182+
${{ inputs.authenticated && format('PREBUILT_BASE_IMG={0}', steps.base_name.outputs.image) }}
179183
IC_VERSION=${{ inputs.ic-version && inputs.ic-version || steps.meta.outputs.version }}
180184
if: ${{ steps.base_exists.outputs.exists != 'true' || steps.target_exists.outputs.exists != 'true' }}
181185

.github/workflows/build-plus.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,16 @@ jobs:
109109
env:
110110
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
111111

112-
- name: Check if base images exist
113-
id: base_exists
112+
- name: Set base name variable
113+
id: base_name
114114
run: |
115115
base_image="gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-base/plus:${{ inputs.base-image-md5 }}-${{ inputs.image }}${{ steps.nap_modules.outputs.name != '' && format('-{0}', steps.nap_modules.outputs.name) || '' }}${{ contains(inputs.image, 'v5') && '-v5' || '' }}"
116116
echo "image=${base_image}" >> $GITHUB_OUTPUT
117-
if docker pull ${base_image}; then
117+
118+
- name: Check if base images exist
119+
id: base_exists
120+
run: |
121+
if docker pull ${{ steps.base_name.outputs.image }}; then
118122
echo "exists=true" >> $GITHUB_OUTPUT
119123
fi
120124
if: ${{ inputs.authenticated && ! inputs.full-build }}
@@ -126,7 +130,7 @@ jobs:
126130
context: "."
127131
cache-to: type=gha,scope=${{ inputs.image }}${{ steps.nap_modules.outputs.name != '' && format('-{0}', steps.nap_modules.outputs.name) || '' }},mode=max
128132
target: common
129-
tags: ${{ steps.base_exists.outputs.image }}
133+
tags: ${{ steps.base_name.outputs.image }}
130134
platforms: ${{ inputs.platforms }}
131135
pull: true
132136
push: true
@@ -185,7 +189,7 @@ jobs:
185189
provenance: false
186190
build-args: |
187191
BUILD_OS=${{ inputs.image }}
188-
${{ inputs.authenticated && format('PREBUILT_BASE_IMG={0}', steps.base_exists.outputs.image ) }}
192+
${{ inputs.authenticated && format('PREBUILT_BASE_IMG={0}', steps.base_name.outputs.image ) }}
189193
IC_VERSION=${{ inputs.ic-version && inputs.ic-version || steps.meta.outputs.version }}
190194
${{ inputs.nap-modules != '' && format('NAP_MODULES={0}', steps.nap_modules.outputs.name) || '' }}
191195
${{ (contains(inputs.target, 'aws') && inputs.nap-modules != '') && format('NAP_MODULES_AWS={0}', steps.nap_modules.outputs.modules) || '' }}

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ jobs:
405405
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
406406
# clobber overwrites existing assets of the same name
407407
run: |
408-
if ! ${{ inputs.dry_run }}
408+
if ! ${{ inputs.dry_run }}; then
409409
gh release upload --clobber v${{ inputs.nic_version }} \
410410
$(find ./tarballs -type f)
411411
else

0 commit comments

Comments
 (0)