45
45
type : string
46
46
default : docker.io
47
47
48
- # The owner is often the same than the Docker Hub username but does ont have to be.
48
+ # The owner is often the same as the Docker Hub username but does ont have to be.
49
49
# In our case, it is not.
50
50
owner :
51
51
description : Owner of the container image repo
58
58
default : v0.9.18
59
59
required : true
60
60
61
+ stable_tag :
62
+ description : Tag matching the actual stable release version in the format stableYYMM or stableYYMM-X for patch releases
63
+ required : true
64
+
61
65
permissions :
62
66
contents : write
63
67
74
78
VERSION : ${{ inputs.version }}
75
79
76
80
jobs :
81
+ validate-inputs :
82
+ runs-on : ubuntu-latest
83
+ outputs :
84
+ stable_tag : ${{ steps.validate_inputs.outputs.stable_tag }}
85
+
86
+ steps :
87
+ - name : Checkout sources
88
+ uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
89
+
90
+ - name : Validate inputs
91
+ id : validate_inputs
92
+ run : |
93
+ . ./.github/scripts/common/lib.sh
94
+
95
+ VERSION=$(filter_version_from_input "${{ inputs.version }}")
96
+ echo "VERSION=${VERSION}" >> $GITHUB_ENV
97
+
98
+ RELEASE_ID=$(check_release_id "${{ inputs.release_id }}")
99
+ echo "RELEASE_ID=${RELEASE_ID}" >> $GITHUB_ENV
100
+
101
+ STABLE_TAG=$(validate_stable_tag ${{ inputs.stable_tag }})
102
+ echo "stable_tag=${STABLE_TAG}" >> $GITHUB_OUTPUT
103
+
77
104
fetch-artifacts : # this job will be triggered for the polkadot-parachain rc and release or polkadot rc image build
78
105
if : ${{ inputs.binary == 'polkadot-parachain' || inputs.binary == 'chain-spec-builder' || inputs.image_type == 'rc' }}
79
106
runs-on : ubuntu-latest
@@ -102,17 +129,14 @@ jobs:
102
129
run : |
103
130
. ./.github/scripts/common/lib.sh
104
131
105
- VERSION=$(filter_version_from_input "${{ inputs.version }}")
106
- echo "VERSION=${VERSION}" >> $GITHUB_ENV
107
-
108
132
fetch_release_artifacts_from_s3
109
133
110
134
- name : Fetch chain-spec-builder rc artifacts or release artifacts based on release id
111
135
# this step runs only if the workflow is triggered manually and only for chain-spec-builder
112
136
if : ${{ env.EVENT_NAME == 'workflow_dispatch' && inputs.binary == 'chain-spec-builder' }}
113
137
run : |
114
138
. ./.github/scripts/common/lib.sh
115
- RELEASE_ID=$(check_release_id "${{ inputs.release_id }}")
139
+
116
140
fetch_release_artifacts
117
141
118
142
- name : Upload artifacts
@@ -124,7 +148,7 @@ jobs:
124
148
build-container : # this job will be triggered for the polkadot-parachain rc and release or polkadot rc image build
125
149
if : ${{ inputs.binary == 'polkadot-parachain' || inputs.binary == 'chain-spec-builder' || inputs.image_type == 'rc' }}
126
150
runs-on : ubuntu-latest
127
- needs : fetch-artifacts
151
+ needs : [ fetch-artifacts, validate-inputs]
128
152
environment : release
129
153
130
154
steps :
@@ -179,7 +203,7 @@ jobs:
179
203
release=$( echo $VERSION | cut -f1 -d- )
180
204
echo "tag=latest" >> $GITHUB_OUTPUT
181
205
echo "release=${release}" >> $GITHUB_OUTPUT
182
- echo "stable=stable " >> $GITHUB_OUTPUT
206
+ echo "stable=${{ needs.validate-inputs.outputs.stable_tag }} " >> $GITHUB_OUTPUT
183
207
184
208
- name : Build Injected Container image for polkadot rc or chain-spec-builder
185
209
if : ${{ env.BINARY == 'polkadot' || env.BINARY == 'chain-spec-builder' }}
@@ -257,7 +281,7 @@ jobs:
257
281
build-polkadot-release-container : # this job will be triggered for polkadot release build
258
282
if : ${{ inputs.binary == 'polkadot' && inputs.image_type == 'release' }}
259
283
runs-on : ubuntu-latest
260
- needs : fetch-latest-debian-package-version
284
+ needs : [ fetch-latest-debian-package-version, validate-inputs]
261
285
environment : release
262
286
steps :
263
287
- name : Checkout sources
@@ -295,7 +319,7 @@ jobs:
295
319
# TODO: The owner should be used below but buildx does not resolve the VARs
296
320
# TODO: It would be good to get rid of this GHA that we don't really need.
297
321
tags : |
298
- parity/polkadot:stable
322
+ parity/polkadot:${{ needs.validate-inputs.outputs.stable_tag }}
299
323
parity/polkadot:latest
300
324
parity/polkadot:${{ needs.fetch-latest-debian-package-version.outputs.polkadot_container_tag }}
301
325
build-args : |
0 commit comments