Skip to content

Commit 50c0f5a

Browse files
EgorPopelyaevgithub-actions[bot]
authored andcommitted
BACKPORT-CONFLICT
1 parent 4f34361 commit 50c0f5a

16 files changed

+550
-99
lines changed

.github/workflows/release-10_branchoff-stable.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,18 @@ jobs:
3737

3838
- name: Validate inputs
3939
id: validate_inputs
40+
env:
41+
INPUT_NODE_VERSION: ${{ inputs.node_version }}
42+
INPUT_STABLE_VERSION: ${{ inputs.stable_version }}
4043
run: |
4144
. ./.github/scripts/common/lib.sh
4245
43-
if [ -n "${{ inputs.node_version }}" ]; then
44-
node_version=$(filter_version_from_input "${{ inputs.node_version }}")
46+
if [ -n "$INPUT_NODE_VERSION" ]; then
47+
node_version=$(filter_version_from_input "$INPUT_NODE_VERSION")
4548
echo "node_version=${node_version}" >> $GITHUB_OUTPUT
4649
fi
4750
48-
stable_version=$(validate_stable_tag ${{ inputs.stable_version }})
51+
stable_version=$(validate_stable_tag "$INPUT_STABLE_VERSION")
4952
echo "stable_version=${stable_version}" >> $GITHUB_OUTPUT
5053
5154
create-stable-branch:
@@ -103,10 +106,10 @@ jobs:
103106
- name: Bump versions, reorder prdocs and push stable branch
104107
env:
105108
GH_TOKEN: ${{ steps.generate_write_token.outputs.token }}
109+
NODE_VERSION: ${{ needs.validate-inputs.outputs.node_version }}
106110
run: |
107111
. ./.github/scripts/release/release_lib.sh
108112
109-
NODE_VERSION="${{ needs.validate-inputs.outputs.node_version }}"
110113
NODE_VERSION_PATTERN="\(NODE_VERSION[^=]*= \)\".*\""
111114
set_version "$NODE_VERSION_PATTERN" $NODE_VERSION "polkadot/node/primitives/src/lib.rs"
112115
commit_with_message "Bump node version to $NODE_VERSION in polkadot-cli"
@@ -127,12 +130,14 @@ jobs:
127130
if: ${{ inputs.tag_rc }}
128131
env:
129132
GH_TOKEN: ${{ steps.generate_write_token.outputs.token }} # or use a PAT with workflow scope
133+
STABLE_VERSION: ${{ needs.validate-inputs.outputs.stable_version }}
134+
GH_REPOSITORY: ${{ github.repository }}
130135
run: |
131-
stable_tag_base=polkadot-${{ needs.validate-inputs.outputs.stable_version }}
136+
stable_tag_base="polkadot-${STABLE_VERSION}"
132137
gh workflow run release-11_rc-automation.yml \
133-
--repo ${{ github.repository }} \
134-
--ref ${{ needs.validate-inputs.outputs.stable_version }} \
135-
--field version=${stable_tag_base}
138+
--repo "$GH_REPOSITORY" \
139+
--ref "$STABLE_VERSION" \
140+
--field version="${stable_tag_base}"
136141
137142
tag-rc-without-branchoff:
138143
if: ${{ !inputs.is_new_stable && inputs.tag_rc }}

.github/workflows/release-11_rc-automation.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,16 @@ jobs:
6464
# if: ${{ steps.get_rel_product.outputs.product == 'polkadot' }}
6565
id: compute_tag
6666
shell: bash
67+
env:
68+
INPUT_VERSION: ${{ inputs.version }}
6769
run: |
6870
. ./.github/scripts/common/lib.sh
6971
7072
# Get last rc tag if exists, else set it to {version}-rc1
71-
if [[ -z "${{ inputs.version }}" ]]; then
73+
if [[ -z "$INPUT_VERSION" ]]; then
7274
version=v$(get_polkadot_node_version_from_code)
7375
else
74-
version=$(validate_stable_tag ${{ inputs.version }})
76+
version=$(validate_stable_tag "$INPUT_VERSION")
7577
fi
7678
echo "$version"
7779
echo "version=$version" >> $GITHUB_OUTPUT

.github/workflows/release-20_build-rc.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,12 @@ jobs:
5151

5252
- name: Validate inputs
5353
id: validate_inputs
54+
env:
55+
INPUT_RELEASE_TAG: ${{ inputs.release_tag }}
5456
run: |
5557
. ./.github/scripts/common/lib.sh
5658
57-
RELEASE_TAG=$(validate_stable_tag ${{ inputs.release_tag }})
59+
RELEASE_TAG=$(validate_stable_tag "$INPUT_RELEASE_TAG")
5860
echo "release_tag=${RELEASE_TAG}" >> $GITHUB_OUTPUT
5961
6062
build-polkadot-binary:

.github/workflows/release-21_build-runtimes.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,12 @@ jobs:
7070

7171
- name: Validate inputs
7272
id: validate_inputs
73+
env:
74+
INPUT_RELEASE_TAG: ${{ inputs.release_tag }}
7375
run: |
7476
. ./.github/scripts/common/lib.sh
7577
76-
RELEASE_TAG=$(validate_stable_tag ${{ inputs.release_tag }})
78+
RELEASE_TAG=$(validate_stable_tag "$INPUT_RELEASE_TAG")
7779
echo "release_tag=${RELEASE_TAG}" >> $GITHUB_OUTPUT
7880
7981
build-runtimes:

.github/workflows/release-22_combined-rc-runtime-builds-release-draft.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,12 @@ jobs:
7171

7272
- name: Validate inputs
7373
id: validate_inputs
74+
env:
75+
INPUT_RELEASE_TAG: ${{ inputs.release_tag }}
7476
run: |
7577
. ./.github/scripts/common/lib.sh
7678
77-
RELEASE_TAG=$(validate_stable_tag ${{ inputs.release_tag }})
79+
RELEASE_TAG=$(validate_stable_tag "$INPUT_RELEASE_TAG")
7880
echo "release_tag=${RELEASE_TAG}" >> $GITHUB_OUTPUT
7981
8082
build-runtimes-flow:

.github/workflows/release-30_publish_release_draft.yml

Lines changed: 43 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,12 @@ jobs:
7474

7575
- name: Validate inputs
7676
id: validate_inputs
77+
env:
78+
INPUT_RELEASE_TAG: ${{ inputs.release_tag }}
7779
run: |
7880
. ./.github/scripts/common/lib.sh
7981
80-
RELEASE_TAG=$(validate_stable_tag ${{ inputs.release_tag }})
82+
RELEASE_TAG=$(validate_stable_tag "$INPUT_RELEASE_TAG")
8183
echo "release_tag=${RELEASE_TAG}" >> $GITHUB_OUTPUT
8284
8385
@@ -106,10 +108,11 @@ jobs:
106108
if: ${{ inputs.no_runtimes == false && inputs.crates_only == false }}
107109
env:
108110
GITHUB_TOKEN: ${{ steps.generate_write_token.outputs.token }}
111+
BUILD_RUN_ID: ${{ inputs.build_run_id }}
109112
run: |
110-
mkdir -p ${{ github.workspace}}/runtimes/
111-
gh run download ${{ inputs.build_run_id }} --dir ${{ github.workspace}}/runtimes
112-
ls -la ${{ github.workspace}}/runtimes
113+
mkdir -p "${GITHUB_WORKSPACE}/runtimes/"
114+
gh run download "$BUILD_RUN_ID" --dir "${GITHUB_WORKSPACE}/runtimes"
115+
ls -la "${GITHUB_WORKSPACE}/runtimes"
113116
114117
- name: Prepare tooling
115118
run: |
@@ -131,6 +134,7 @@ jobs:
131134
RELEASE_TAG: ${{ needs.validate-inputs.outputs.release_tag }}
132135
NO_RUNTIMES: ${{ inputs.no_runtimes }}
133136
CRATES_ONLY: ${{ inputs.crates_only }}
137+
GH_REF_NAME: ${{ github.ref_name }}
134138
shell: bash
135139
run: |
136140
. ./.github/scripts/common/lib.sh
@@ -139,7 +143,7 @@ jobs:
139143
140144
export REF1=$(get_latest_release_tag)
141145
if [[ -z "$RELEASE_TAG" ]]; then
142-
export REF2="${{ github.ref_name }}"
146+
export REF2="${GH_REF_NAME}"
143147
echo "REF2: ${REF2}"
144148
else
145149
export REF2="$RELEASE_TAG"
@@ -203,28 +207,32 @@ jobs:
203207
- name: Download runtimes
204208
env:
205209
GITHUB_TOKEN: ${{ steps.generate_write_token.outputs.token }}
210+
BUILD_RUN_ID: ${{ inputs.build_run_id }}
206211
run: |
207-
mkdir -p ${{ github.workspace}}/runtimes/
208-
gh run download ${{ inputs.build_run_id }} --dir ${{ github.workspace}}/runtimes
209-
ls -la ${{ github.workspace}}/runtimes
212+
mkdir -p "${GITHUB_WORKSPACE}/runtimes/"
213+
gh run download "$BUILD_RUN_ID" --dir "${GITHUB_WORKSPACE}/runtimes"
214+
ls -la "${GITHUB_WORKSPACE}/runtimes"
210215
211216
- name: Get runtime info
212217
env:
218+
CHAIN: ${{ matrix.chain }}
213219
JSON: ${{ github.workspace}}/release-notes-context/runtimes/${{ matrix.chain }}-runtime/${{ matrix.chain }}-srtool-digest.json
214220
run: |
215-
cd ${{ github.workspace}}/runtimes
216-
>>$GITHUB_ENV echo ASSET=$(find ${{ matrix.chain }}-runtime -name '*.compact.compressed.wasm')
221+
cd "${GITHUB_WORKSPACE}/runtimes"
222+
>>$GITHUB_ENV echo ASSET=$(find "${CHAIN}-runtime" -name '*.compact.compressed.wasm')
217223
>>$GITHUB_ENV echo SPEC=$(<${JSON} jq -r .runtimes.compact.subwasm.core_version.specVersion)
218224
219225
- name: Upload compressed ${{ matrix.chain }} v${{ env.SPEC }} wasm
220226
working-directory: ${{ github.workspace}}/runtimes
221227
env:
222228
GITHUB_TOKEN: ${{ steps.generate_write_token.outputs.token }}
229+
CHAIN: ${{ matrix.chain }}
230+
VALIDATED_RELEASE_TAG: ${{ needs.validate-inputs.outputs.release_tag }}
223231
run: |
224-
VERSIONED_ASSET="${{ matrix.chain }}_runtime-v${{ env.SPEC }}.compact.compressed.wasm"
232+
VERSIONED_ASSET="${CHAIN}_runtime-v${{ env.SPEC }}.compact.compressed.wasm"
225233
mv "${{ env.ASSET }}" "$VERSIONED_ASSET"
226234
227-
gh release upload ${{ needs.validate-inputs.outputs.release_tag }} \
235+
gh release upload "$VALIDATED_RELEASE_TAG" \
228236
--repo paritytech/polkadot-sdk "$VERSIONED_ASSET"
229237
230238
publish-release-artifacts:
@@ -243,23 +251,28 @@ jobs:
243251
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
244252

245253
- name: Fetch binaries from s3 based on version
254+
env:
255+
VERSION: ${{ needs.validate-inputs.outputs.release_tag }}
256+
BINARY: ${{ matrix.binary }}
257+
TARGET: ${{ matrix.target }}
246258
run: |
247259
. ./.github/scripts/common/lib.sh
248260
249-
VERSION="${{ needs.validate-inputs.outputs.release_tag }}"
250-
fetch_release_artifacts_from_s3 ${{ matrix.binary }} ${{ matrix.target }}
261+
fetch_release_artifacts_from_s3 "$BINARY" "$TARGET"
251262
252263
- name: Rename aarch64-apple-darwin binaries
253264
if: ${{ matrix.target == 'aarch64-apple-darwin' }}
254265
working-directory: ${{ github.workspace}}/release-artifacts/${{ matrix.target }}/${{ matrix.binary }}
266+
env:
267+
BINARY: ${{ matrix.binary }}
255268
run: |
256269
. ../../../.github/scripts/common/lib.sh
257270
258-
mv ${{ matrix.binary }} ${{ matrix.binary }}-aarch64-apple-darwin
259-
mv ${{ matrix.binary }}.asc ${{ matrix.binary }}-aarch64-apple-darwin.asc
271+
mv "$BINARY" "${BINARY}-aarch64-apple-darwin"
272+
mv "${BINARY}.asc" "${BINARY}-aarch64-apple-darwin.asc"
260273
261-
sha256sum "${{ matrix.binary }}-aarch64-apple-darwin" | tee "${{ matrix.binary }}-aarch64-apple-darwin.sha256"
262-
check_sha256 "${{ matrix.binary }}-aarch64-apple-darwin" && echo "OK" || echo "ERR"
274+
sha256sum "${BINARY}-aarch64-apple-darwin" | tee "${BINARY}-aarch64-apple-darwin.sha256"
275+
check_sha256 "${BINARY}-aarch64-apple-darwin" && echo "OK" || echo "ERR"
263276
264277
- name: Generate content write token for the release automation
265278
id: generate_write_token
@@ -273,20 +286,23 @@ jobs:
273286
- name: Upload ${{ matrix.binary }} binary to release draft
274287
env:
275288
GITHUB_TOKEN: ${{ steps.generate_write_token.outputs.token }}
289+
BINARY: ${{ matrix.binary }}
290+
TARGET: ${{ matrix.target }}
291+
VALIDATED_RELEASE_TAG: ${{ needs.validate-inputs.outputs.release_tag }}
276292
working-directory: ${{ github.workspace}}/release-artifacts/${{ matrix.target }}/${{ matrix.binary }}
277293
run: |
278-
if [[ ${{ matrix.target }} == "aarch64-apple-darwin" ]]; then
279-
gh release upload ${{ needs.validate-inputs.outputs.release_tag }} \
294+
if [[ "$TARGET" == "aarch64-apple-darwin" ]]; then
295+
gh release upload "$VALIDATED_RELEASE_TAG" \
280296
--repo paritytech/polkadot-sdk \
281-
${{ matrix.binary }}-aarch64-apple-darwin \
282-
${{ matrix.binary }}-aarch64-apple-darwin.asc \
283-
${{ matrix.binary }}-aarch64-apple-darwin.sha256
297+
"${BINARY}-aarch64-apple-darwin" \
298+
"${BINARY}-aarch64-apple-darwin.asc" \
299+
"${BINARY}-aarch64-apple-darwin.sha256"
284300
else
285-
gh release upload ${{ needs.validate-inputs.outputs.release_tag }} \
301+
gh release upload "$VALIDATED_RELEASE_TAG" \
286302
--repo paritytech/polkadot-sdk \
287-
${{ matrix.binary }} \
288-
${{ matrix.binary }}.asc \
289-
${{ matrix.binary }}.sha256
303+
"$BINARY" \
304+
"${BINARY}.asc" \
305+
"${BINARY}.sha256"
290306
fi
291307
292308
post_to_matrix:

.github/workflows/release-31_promote-rc-to-final.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@ jobs:
4040

4141
- name: Validate inputs
4242
id: validate_inputs
43+
env:
44+
INPUT_RELEASE_TAG: ${{ inputs.release_tag }}
4345
run: |
4446
. ./.github/scripts/common/lib.sh
4547
46-
RELEASE_TAG=$(validate_stable_tag ${{ inputs.release_tag }})
48+
RELEASE_TAG=$(validate_stable_tag "$INPUT_RELEASE_TAG")
4749
echo "release_tag=${RELEASE_TAG}" >> $GITHUB_OUTPUT
4850
4951
promote-polkadot-rc-to-final:

.github/workflows/release-50_publish-docker.yml

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,16 @@ jobs:
8383

8484
- name: Validate inputs
8585
id: validate_inputs
86+
env:
87+
INPUT_VERSION: ${{ inputs.version }}
88+
INPUT_STABLE_TAG: ${{ inputs.stable_tag }}
8689
run: |
8790
. ./.github/scripts/common/lib.sh
8891
89-
VERSION=$(filter_version_from_input "${{ inputs.version }}")
92+
VERSION=$(filter_version_from_input "$INPUT_VERSION")
9093
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
9194
92-
STABLE_TAG=$(validate_stable_tag ${{ inputs.stable_tag }})
95+
STABLE_TAG=$(validate_stable_tag "$INPUT_STABLE_TAG")
9396
echo "stable_tag=${STABLE_TAG}" >> $GITHUB_OUTPUT
9497
9598
fetch-artifacts: # this job will be triggered for the polkadot-parachain rc and release or polkadot rc image build
@@ -102,12 +105,17 @@ jobs:
102105
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
103106

104107
- name: Fetch rc artifacts or release artifacts from s3 based on version
108+
<<<<<<< HEAD
105109
# if: ${{ env.EVENT_NAME == 'workflow_dispatch' && inputs.binary != 'polkadot-omni-node' && inputs.binary != 'chain-spec-builder'}}
110+
=======
111+
if: ${{ inputs.binary == 'polkadot-omni-node' || inputs.binary == 'polkadot-parachain' || inputs.binary == 'chain-spec-builder' || inputs.image_type == 'rc' }}
112+
env:
113+
VERSION: ${{ needs.validate-inputs.outputs.stable_tag }}
114+
>>>>>>> cf88f8c3 ([Release|CI/CD] Replace direct use of inputs with ENVs (#11116))
106115
run: |
107116
. ./.github/scripts/common/lib.sh
108117
109-
VERSION="${{ needs.validate-inputs.outputs.stable_tag }}"
110-
if [[ ${{ inputs.binary }} == 'polkadot' ]]; then
118+
if [[ "$BINARY" == 'polkadot' ]]; then
111119
bins=(polkadot polkadot-prepare-worker polkadot-execute-worker)
112120
for bin in "${bins[@]}"; do
113121
fetch_release_artifacts_from_s3 $bin x86_64-unknown-linux-gnu
@@ -157,25 +165,31 @@ jobs:
157165
if: ${{ env.IMAGE_TYPE == 'rc' }}
158166
id: fetch_rc_refs
159167
shell: bash
168+
env:
169+
VALIDATED_VERSION: ${{ needs.validate-inputs.outputs.version }}
170+
VALIDATED_STABLE_TAG: ${{ needs.validate-inputs.outputs.stable_tag }}
160171
run: |
161172
. ../.github/scripts/common/lib.sh
162173
163174
commit=$(git rev-parse --short HEAD) && \
164175
echo "commit=${commit}" >> $GITHUB_OUTPUT
165-
echo "release=$(echo ${{ needs.validate-inputs.outputs.version }})" >> $GITHUB_OUTPUT
166-
echo "tag=$(prepare_docker_stable_tag ${{ needs.validate-inputs.outputs.stable_tag }})" >> $GITHUB_OUTPUT
176+
echo "release=${VALIDATED_VERSION}" >> $GITHUB_OUTPUT
177+
echo "tag=$(prepare_docker_stable_tag "$VALIDATED_STABLE_TAG")" >> $GITHUB_OUTPUT
167178
168179
- name: Fetch release tags
169180
working-directory: release-artifacts
170181
if: ${{ env.IMAGE_TYPE == 'release'}}
171182
id: fetch_release_refs
172183
shell: bash
184+
env:
185+
VALIDATED_VERSION: ${{ needs.validate-inputs.outputs.version }}
186+
VALIDATED_STABLE_TAG: ${{ needs.validate-inputs.outputs.stable_tag }}
173187
run: |
174188
. ../.github/scripts/common/lib.sh
175189
176190
echo "tag=latest" >> $GITHUB_OUTPUT
177-
echo "release=$(echo ${{ needs.validate-inputs.outputs.version }})" >> $GITHUB_OUTPUT
178-
echo "stable=$(prepare_docker_stable_tag ${{ needs.validate-inputs.outputs.stable_tag }})" >> $GITHUB_OUTPUT
191+
echo "release=${VALIDATED_VERSION}" >> $GITHUB_OUTPUT
192+
echo "stable=$(prepare_docker_stable_tag "$VALIDATED_STABLE_TAG")" >> $GITHUB_OUTPUT
179193
180194
- name: Build Injected Container image for polkadot rc
181195
if: ${{ env.BINARY == 'polkadot' }}
@@ -184,10 +198,33 @@ jobs:
184198
IMAGE_NAME: ${{ env.BINARY }}
185199
OWNER: ${{ env.DOCKER_OWNER }}
186200
TAGS: ${{ join(steps.fetch_rc_refs.outputs.*, ',') || join(steps.fetch_release_refs.outputs.*, ',') }}
201+
<<<<<<< HEAD
187202
run: |
188203
ls -al
189204
echo "Building container for $BINARY"
190205
./docker/scripts/polkadot/build-injected.sh $ARTIFACTS_FOLDER
206+
=======
207+
VALIDATED_VERSION: ${{ needs.validate-inputs.outputs.version }}
208+
shell: bash
209+
run: |
210+
ls -al
211+
echo "Building container for $BINARY"
212+
echo "IMAGE_TYPE: $IMAGE_TYPE"
213+
214+
if [[ "$IMAGE_TYPE" == "rc" ]]; then
215+
echo "Building RC container for polkadot"
216+
export DOCKERFILE="docker/dockerfiles/polkadot/polkadot_injected.Dockerfile"
217+
export BINARY="polkadot,polkadot-execute-worker,polkadot-prepare-worker"
218+
./docker/scripts/build-injected.sh
219+
else
220+
echo "Building release container for polkadot"
221+
export DOCKERFILE="docker/dockerfiles/polkadot/polkadot_injected_debian.Dockerfile"
222+
export BINARY="polkadot,polkadot-execute-worker,polkadot-prepare-worker"
223+
export POLKADOT_DEB=true
224+
export VERSION="$VALIDATED_VERSION"
225+
./docker/scripts/build-injected.sh
226+
fi
227+
>>>>>>> cf88f8c3 ([Release|CI/CD] Replace direct use of inputs with ENVs (#11116))
191228

192229
- name: Build Injected Container image for polkadot-omni-node/chain-spec-builder
193230
if: ${{ env.BINARY == 'polkadot-omni-node' || env.BINARY == 'chain-spec-builder' }}

0 commit comments

Comments
 (0)