From f23cc60484d420e9323df99197cd2e4030987495 Mon Sep 17 00:00:00 2001 From: Iulian Barbu Date: Thu, 5 Jun 2025 10:13:51 +0000 Subject: [PATCH 1/3] add optional features to the node building Signed-off-by: Iulian Barbu --- .github/scripts/release/build-linux-release.sh | 7 ++++++- .github/workflows/release-build-binary.yml | 8 ++++++-- .github/workflows/release-reusable-rc-buid.yml | 9 +++++++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/scripts/release/build-linux-release.sh b/.github/scripts/release/build-linux-release.sh index 413a3274edf30..40898058b758e 100755 --- a/.github/scripts/release/build-linux-release.sh +++ b/.github/scripts/release/build-linux-release.sh @@ -9,6 +9,11 @@ BIN=$1 PACKAGE=${2:-$BIN} +# must be given as feature1,feature2,feature3... +FEATURES=$3 +if [ -n "$FEATURES" ]; then + FEATURES="--features ${FEATURES}" +fi PROFILE=${PROFILE:-production} ARTIFACTS=/artifacts/$BIN @@ -17,7 +22,7 @@ echo "Artifacts will be copied into $ARTIFACTS" mkdir -p "$ARTIFACTS" git log --pretty=oneline -n 1 -time cargo build --profile $PROFILE --locked --verbose --bin $BIN --package $PACKAGE +time cargo build --profile $PROFILE --locked --verbose --bin $BIN --package $PACKAGE $FEATURES echo "Artifact target: $ARTIFACTS" diff --git a/.github/workflows/release-build-binary.yml b/.github/workflows/release-build-binary.yml index 59a8f9da7cc92..a5adab421a8a4 100644 --- a/.github/workflows/release-build-binary.yml +++ b/.github/workflows/release-build-binary.yml @@ -18,6 +18,10 @@ on: required: true default: "release" description: "The profile to use for the binary build" + features: + required: false + type: string + description: "Features to enable when building the binary (must be a list of comma-separated features)" jobs: @@ -63,10 +67,10 @@ jobs: if [ "${{ inputs.binary }}" = "polkadot" ]; then for binary in polkadot polkadot-prepare-worker polkadot-execute-worker; do echo "Building $binary..." - ./.github/scripts/release/build-linux-release.sh $binary ${{ inputs.package }} "${PROFILE}" + ./.github/scripts/release/build-linux-release.sh $binary ${{ inputs.package }} "${PROFILE}" ${{ inputs.features }} done else - ./.github/scripts/release/build-linux-release.sh ${{ inputs.binary }} ${{ inputs.package }} "${PROFILE}" + ./.github/scripts/release/build-linux-release.sh ${{ inputs.binary }} ${{ inputs.package }} "${PROFILE}" ${{ inputs.features }} fi - name: Upload ${{ inputs.binary }} artifacts diff --git a/.github/workflows/release-reusable-rc-buid.yml b/.github/workflows/release-reusable-rc-buid.yml index f40568c2e7771..4d418d1fb891b 100644 --- a/.github/workflows/release-reusable-rc-buid.yml +++ b/.github/workflows/release-reusable-rc-buid.yml @@ -24,6 +24,11 @@ on: required: true type: string + features: + description: Features to be enabled when building the binary (must be a list of comma-separated features) + required: false + type: string + secrets: PGP_KMS_KEY: required: true @@ -101,7 +106,7 @@ jobs: - name: Build binary run: | git config --global --add safe.directory "${GITHUB_WORKSPACE}" #avoid "detected dubious ownership" error - ./.github/scripts/release/build-linux-release.sh ${{ matrix.binaries }} ${{ inputs.package }} + ./.github/scripts/release/build-linux-release.sh ${{ matrix.binaries }} ${{ inputs.package }} ${{ inputs.features }} - name: Generate artifact attestation uses: actions/attest-build-provenance@c074443f1aee8d4aeeae555aebba3282517141b2 # v2.2.3 @@ -216,7 +221,7 @@ jobs: - name: Build binary run: | git config --global --add safe.directory "${GITHUB_WORKSPACE}" #avoid "detected dubious ownership" error - ./.github/scripts/release/build-macos-release.sh ${{ matrix.binaries }} ${{ inputs.package }} + ./.github/scripts/release/build-macos-release.sh ${{ matrix.binaries }} ${{ inputs.package }} ${{ inputs.features }} - name: Generate artifact attestation uses: actions/attest-build-provenance@c074443f1aee8d4aeeae555aebba3282517141b2 # v2.2.3 From bc8b4a66f3f507b48efbdd5dcc346670f4f7736e Mon Sep 17 00:00:00 2001 From: Iulian Barbu Date: Thu, 5 Jun 2025 10:20:31 +0000 Subject: [PATCH 2/3] add runtime-benchmarks feature for building omni-node/polkadot-parachain Signed-off-by: Iulian Barbu --- .github/workflows/release-20_build-rc.yml | 24 +++++++++++-------- ...buid.yml => release-reusable-rc-build.yml} | 0 2 files changed, 14 insertions(+), 10 deletions(-) rename .github/workflows/{release-reusable-rc-buid.yml => release-reusable-rc-build.yml} (100%) diff --git a/.github/workflows/release-20_build-rc.yml b/.github/workflows/release-20_build-rc.yml index 594356d4a06ba..642e6988e4ad7 100644 --- a/.github/workflows/release-20_build-rc.yml +++ b/.github/workflows/release-20_build-rc.yml @@ -47,7 +47,7 @@ jobs: build-polkadot-binary: needs: [validate-inputs] if: ${{ inputs.binary == 'polkadot' || inputs.binary == 'all' }} - uses: "./.github/workflows/release-reusable-rc-buid.yml" + uses: "./.github/workflows/release-reusable-rc-build.yml" with: binary: '["polkadot", "polkadot-prepare-worker", "polkadot-execute-worker"]' package: polkadot @@ -69,12 +69,13 @@ jobs: build-polkadot-parachain-binary: needs: [validate-inputs] if: ${{ inputs.binary == 'polkadot-parachain' || inputs.binary == 'all' }} - uses: "./.github/workflows/release-reusable-rc-buid.yml" + uses: "./.github/workflows/release-reusable-rc-build.yml" with: binary: '["polkadot-parachain"]' package: "polkadot-parachain-bin" release_tag: ${{ needs.validate-inputs.outputs.release_tag }} target: x86_64-unknown-linux-gnu + features: runtime-benchmarks secrets: PGP_KMS_KEY: ${{ secrets.PGP_KMS_KEY }} PGP_KMS_HASH: ${{ secrets.PGP_KMS_HASH }} @@ -91,12 +92,13 @@ jobs: build-polkadot-omni-node-binary: needs: [validate-inputs] if: ${{ inputs.binary == 'polkadot-omni-node' || inputs.binary == 'all' }} - uses: "./.github/workflows/release-reusable-rc-buid.yml" + uses: "./.github/workflows/release-reusable-rc-build.yml" with: binary: '["polkadot-omni-node"]' package: "polkadot-omni-node" release_tag: ${{ needs.validate-inputs.outputs.release_tag }} target: x86_64-unknown-linux-gnu + features: runtime-benchmarks secrets: PGP_KMS_KEY: ${{ secrets.PGP_KMS_KEY }} PGP_KMS_HASH: ${{ secrets.PGP_KMS_HASH }} @@ -113,7 +115,7 @@ jobs: build-frame-omni-bencher-binary: needs: [validate-inputs] if: ${{ inputs.binary == 'frame-omni-bencher' || inputs.binary == 'all' }} - uses: "./.github/workflows/release-reusable-rc-buid.yml" + uses: "./.github/workflows/release-reusable-rc-build.yml" with: binary: '["frame-omni-bencher"]' package: "frame-omni-bencher" @@ -135,7 +137,7 @@ jobs: build-chain-spec-builder-binary: needs: [validate-inputs] if: ${{ inputs.binary == 'chain-spec-builder' || inputs.binary == 'all' }} - uses: "./.github/workflows/release-reusable-rc-buid.yml" + uses: "./.github/workflows/release-reusable-rc-build.yml" with: binary: '["chain-spec-builder"]' package: staging-chain-spec-builder @@ -157,7 +159,7 @@ jobs: build-polkadot-macos-binary: needs: [validate-inputs] if: ${{ inputs.binary == 'polkadot' || inputs.binary == 'all' }} - uses: "./.github/workflows/release-reusable-rc-buid.yml" + uses: "./.github/workflows/release-reusable-rc-build.yml" with: binary: '["polkadot", "polkadot-prepare-worker", "polkadot-execute-worker"]' package: polkadot @@ -179,12 +181,13 @@ jobs: build-polkadot-parachain-macos-binary: needs: [validate-inputs] if: ${{ inputs.binary == 'polkadot-parachain' || inputs.binary == 'all' }} - uses: "./.github/workflows/release-reusable-rc-buid.yml" + uses: "./.github/workflows/release-reusable-rc-build.yml" with: binary: '["polkadot-parachain"]' package: polkadot-parachain-bin release_tag: ${{ needs.validate-inputs.outputs.release_tag }} target: aarch64-apple-darwin + features: runtime-benchmarks secrets: PGP_KMS_KEY: ${{ secrets.PGP_KMS_KEY }} PGP_KMS_HASH: ${{ secrets.PGP_KMS_HASH }} @@ -201,12 +204,13 @@ jobs: build-polkadot-omni-node-macos-binary: needs: [validate-inputs] if: ${{ inputs.binary == 'polkadot-omni-node' || inputs.binary == 'all' }} - uses: "./.github/workflows/release-reusable-rc-buid.yml" + uses: "./.github/workflows/release-reusable-rc-build.yml" with: binary: '["polkadot-omni-node"]' package: polkadot-omni-node release_tag: ${{ needs.validate-inputs.outputs.release_tag }} target: aarch64-apple-darwin + features: runtime-benchmarks secrets: PGP_KMS_KEY: ${{ secrets.PGP_KMS_KEY }} PGP_KMS_HASH: ${{ secrets.PGP_KMS_HASH }} @@ -223,7 +227,7 @@ jobs: build-frame-omni-bencher-macos-binary: needs: [validate-inputs] if: ${{ inputs.binary == 'frame-omni-bencher' || inputs.binary == 'all' }} - uses: "./.github/workflows/release-reusable-rc-buid.yml" + uses: "./.github/workflows/release-reusable-rc-build.yml" with: binary: '["frame-omni-bencher"]' package: frame-omni-bencher @@ -245,7 +249,7 @@ jobs: build-chain-spec-builder-macos-binary: needs: [validate-inputs] if: ${{ inputs.binary == 'chain-spec-builder' || inputs.binary == 'all' }} - uses: "./.github/workflows/release-reusable-rc-buid.yml" + uses: "./.github/workflows/release-reusable-rc-build.yml" with: binary: '["chain-spec-builder"]' package: staging-chain-spec-builder diff --git a/.github/workflows/release-reusable-rc-buid.yml b/.github/workflows/release-reusable-rc-build.yml similarity index 100% rename from .github/workflows/release-reusable-rc-buid.yml rename to .github/workflows/release-reusable-rc-build.yml From fd114070b0316acd86a1bc7d5138f103490846d2 Mon Sep 17 00:00:00 2001 From: Iulian Barbu Date: Fri, 6 Jun 2025 11:52:48 +0000 Subject: [PATCH 3/3] disable runtime-benchmarks building for polkadot-parachain Signed-off-by: Iulian Barbu --- .github/workflows/release-20_build-rc.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/release-20_build-rc.yml b/.github/workflows/release-20_build-rc.yml index 642e6988e4ad7..6b4c67b832685 100644 --- a/.github/workflows/release-20_build-rc.yml +++ b/.github/workflows/release-20_build-rc.yml @@ -75,7 +75,6 @@ jobs: package: "polkadot-parachain-bin" release_tag: ${{ needs.validate-inputs.outputs.release_tag }} target: x86_64-unknown-linux-gnu - features: runtime-benchmarks secrets: PGP_KMS_KEY: ${{ secrets.PGP_KMS_KEY }} PGP_KMS_HASH: ${{ secrets.PGP_KMS_HASH }} @@ -187,7 +186,6 @@ jobs: package: polkadot-parachain-bin release_tag: ${{ needs.validate-inputs.outputs.release_tag }} target: aarch64-apple-darwin - features: runtime-benchmarks secrets: PGP_KMS_KEY: ${{ secrets.PGP_KMS_KEY }} PGP_KMS_HASH: ${{ secrets.PGP_KMS_HASH }}