Skip to content

Commit dfa3e3b

Browse files
paritytech-release-backport-bot[bot]iulianbarbuEgorPopelyaev
authored
[stable2503] Backport #8755 (#8814)
Backport #8755 into `stable2503` from iulianbarbu. See the [documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md) on how to use this bot. <!-- # To be used by other automation, do not modify: original-pr-number: #${pull_number} --> Signed-off-by: Iulian Barbu <[email protected]> Co-authored-by: Iulian Barbu <[email protected]> Co-authored-by: Egor_P <[email protected]>
1 parent ab3592b commit dfa3e3b

File tree

4 files changed

+31
-15
lines changed

4 files changed

+31
-15
lines changed

.github/scripts/release/build-linux-release.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99

1010
BIN=$1
1111
PACKAGE=${2:-$BIN}
12+
# must be given as feature1,feature2,feature3...
13+
FEATURES=$3
14+
if [ -n "$FEATURES" ]; then
15+
FEATURES="--features ${FEATURES}"
16+
fi
1217

1318
PROFILE=${PROFILE:-production}
1419
ARTIFACTS=/artifacts/$BIN
@@ -17,7 +22,7 @@ echo "Artifacts will be copied into $ARTIFACTS"
1722
mkdir -p "$ARTIFACTS"
1823

1924
git log --pretty=oneline -n 1
20-
time cargo build --profile $PROFILE --locked --verbose --bin $BIN --package $PACKAGE
25+
time cargo build --profile $PROFILE --locked --verbose --bin $BIN --package $PACKAGE $FEATURES
2126

2227
echo "Artifact target: $ARTIFACTS"
2328

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

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
build-polkadot-binary:
4848
needs: [validate-inputs]
4949
if: ${{ inputs.binary == 'polkadot' || inputs.binary == 'all' }}
50-
uses: "./.github/workflows/release-reusable-rc-buid.yml"
50+
uses: "./.github/workflows/release-reusable-rc-build.yml"
5151
with:
5252
binary: '["polkadot", "polkadot-prepare-worker", "polkadot-execute-worker"]'
5353
package: polkadot
@@ -69,7 +69,7 @@ jobs:
6969
build-polkadot-parachain-binary:
7070
needs: [validate-inputs]
7171
if: ${{ inputs.binary == 'polkadot-parachain' || inputs.binary == 'all' }}
72-
uses: "./.github/workflows/release-reusable-rc-buid.yml"
72+
uses: "./.github/workflows/release-reusable-rc-build.yml"
7373
with:
7474
binary: '["polkadot-parachain"]'
7575
package: "polkadot-parachain-bin"
@@ -91,12 +91,13 @@ jobs:
9191
build-polkadot-omni-node-binary:
9292
needs: [validate-inputs]
9393
if: ${{ inputs.binary == 'polkadot-omni-node' || inputs.binary == 'all' }}
94-
uses: "./.github/workflows/release-reusable-rc-buid.yml"
94+
uses: "./.github/workflows/release-reusable-rc-build.yml"
9595
with:
9696
binary: '["polkadot-omni-node"]'
9797
package: "polkadot-omni-node"
9898
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
9999
target: x86_64-unknown-linux-gnu
100+
features: runtime-benchmarks
100101
secrets:
101102
PGP_KMS_KEY: ${{ secrets.PGP_KMS_KEY }}
102103
PGP_KMS_HASH: ${{ secrets.PGP_KMS_HASH }}
@@ -113,7 +114,7 @@ jobs:
113114
build-frame-omni-bencher-binary:
114115
needs: [validate-inputs]
115116
if: ${{ inputs.binary == 'frame-omni-bencher' || inputs.binary == 'all' }}
116-
uses: "./.github/workflows/release-reusable-rc-buid.yml"
117+
uses: "./.github/workflows/release-reusable-rc-build.yml"
117118
with:
118119
binary: '["frame-omni-bencher"]'
119120
package: "frame-omni-bencher"
@@ -135,7 +136,7 @@ jobs:
135136
build-chain-spec-builder-binary:
136137
needs: [validate-inputs]
137138
if: ${{ inputs.binary == 'chain-spec-builder' || inputs.binary == 'all' }}
138-
uses: "./.github/workflows/release-reusable-rc-buid.yml"
139+
uses: "./.github/workflows/release-reusable-rc-build.yml"
139140
with:
140141
binary: '["chain-spec-builder"]'
141142
package: staging-chain-spec-builder
@@ -157,7 +158,7 @@ jobs:
157158
build-polkadot-macos-binary:
158159
needs: [validate-inputs]
159160
if: ${{ inputs.binary == 'polkadot' || inputs.binary == 'all' }}
160-
uses: "./.github/workflows/release-reusable-rc-buid.yml"
161+
uses: "./.github/workflows/release-reusable-rc-build.yml"
161162
with:
162163
binary: '["polkadot", "polkadot-prepare-worker", "polkadot-execute-worker"]'
163164
package: polkadot
@@ -179,7 +180,7 @@ jobs:
179180
build-polkadot-parachain-macos-binary:
180181
needs: [validate-inputs]
181182
if: ${{ inputs.binary == 'polkadot-parachain' || inputs.binary == 'all' }}
182-
uses: "./.github/workflows/release-reusable-rc-buid.yml"
183+
uses: "./.github/workflows/release-reusable-rc-build.yml"
183184
with:
184185
binary: '["polkadot-parachain"]'
185186
package: polkadot-parachain-bin
@@ -201,12 +202,13 @@ jobs:
201202
build-polkadot-omni-node-macos-binary:
202203
needs: [validate-inputs]
203204
if: ${{ inputs.binary == 'polkadot-omni-node' || inputs.binary == 'all' }}
204-
uses: "./.github/workflows/release-reusable-rc-buid.yml"
205+
uses: "./.github/workflows/release-reusable-rc-build.yml"
205206
with:
206207
binary: '["polkadot-omni-node"]'
207208
package: polkadot-omni-node
208209
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
209210
target: aarch64-apple-darwin
211+
features: runtime-benchmarks
210212
secrets:
211213
PGP_KMS_KEY: ${{ secrets.PGP_KMS_KEY }}
212214
PGP_KMS_HASH: ${{ secrets.PGP_KMS_HASH }}
@@ -223,7 +225,7 @@ jobs:
223225
build-frame-omni-bencher-macos-binary:
224226
needs: [validate-inputs]
225227
if: ${{ inputs.binary == 'frame-omni-bencher' || inputs.binary == 'all' }}
226-
uses: "./.github/workflows/release-reusable-rc-buid.yml"
228+
uses: "./.github/workflows/release-reusable-rc-build.yml"
227229
with:
228230
binary: '["frame-omni-bencher"]'
229231
package: frame-omni-bencher
@@ -245,7 +247,7 @@ jobs:
245247
build-chain-spec-builder-macos-binary:
246248
needs: [validate-inputs]
247249
if: ${{ inputs.binary == 'chain-spec-builder' || inputs.binary == 'all' }}
248-
uses: "./.github/workflows/release-reusable-rc-buid.yml"
250+
uses: "./.github/workflows/release-reusable-rc-build.yml"
249251
with:
250252
binary: '["chain-spec-builder"]'
251253
package: staging-chain-spec-builder

.github/workflows/release-build-binary.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ on:
1818
required: true
1919
default: "release"
2020
description: "The profile to use for the binary build"
21+
features:
22+
required: false
23+
type: string
24+
description: "Features to enable when building the binary (must be a list of comma-separated features)"
2125

2226
jobs:
2327

@@ -63,10 +67,10 @@ jobs:
6367
if [ "${{ inputs.binary }}" = "polkadot" ]; then
6468
for binary in polkadot polkadot-prepare-worker polkadot-execute-worker; do
6569
echo "Building $binary..."
66-
./.github/scripts/release/build-linux-release.sh $binary ${{ inputs.package }} "${PROFILE}"
70+
./.github/scripts/release/build-linux-release.sh $binary ${{ inputs.package }} "${PROFILE}" ${{ inputs.features }}
6771
done
6872
else
69-
./.github/scripts/release/build-linux-release.sh ${{ inputs.binary }} ${{ inputs.package }} "${PROFILE}"
73+
./.github/scripts/release/build-linux-release.sh ${{ inputs.binary }} ${{ inputs.package }} "${PROFILE}" ${{ inputs.features }}
7074
fi
7175
7276
- name: Upload ${{ inputs.binary }} artifacts

.github/workflows/release-reusable-rc-buid.yml renamed to .github/workflows/release-reusable-rc-build.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ on:
2424
required: true
2525
type: string
2626

27+
features:
28+
description: Features to be enabled when building the binary (must be a list of comma-separated features)
29+
required: false
30+
type: string
31+
2732
secrets:
2833
PGP_KMS_KEY:
2934
required: true
@@ -101,7 +106,7 @@ jobs:
101106
- name: Build binary
102107
run: |
103108
git config --global --add safe.directory "${GITHUB_WORKSPACE}" #avoid "detected dubious ownership" error
104-
./.github/scripts/release/build-linux-release.sh ${{ matrix.binaries }} ${{ inputs.package }}
109+
./.github/scripts/release/build-linux-release.sh ${{ matrix.binaries }} ${{ inputs.package }} ${{ inputs.features }}
105110
106111
- name: Generate artifact attestation
107112
uses: actions/attest-build-provenance@c074443f1aee8d4aeeae555aebba3282517141b2 # v2.2.3
@@ -216,7 +221,7 @@ jobs:
216221
- name: Build binary
217222
run: |
218223
git config --global --add safe.directory "${GITHUB_WORKSPACE}" #avoid "detected dubious ownership" error
219-
./.github/scripts/release/build-macos-release.sh ${{ matrix.binaries }} ${{ inputs.package }}
224+
./.github/scripts/release/build-macos-release.sh ${{ matrix.binaries }} ${{ inputs.package }} ${{ inputs.features }}
220225
221226
- name: Generate artifact attestation
222227
uses: actions/attest-build-provenance@c074443f1aee8d4aeeae555aebba3282517141b2 # v2.2.3

0 commit comments

Comments
 (0)