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-20_build-rc.yml b/.github/workflows/release-20_build-rc.yml index 594356d4a06ba..6b4c67b832685 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,7 +69,7 @@ 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" @@ -91,12 +91,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 +114,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 +136,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 +158,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,7 +180,7 @@ 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 @@ -201,12 +202,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 +225,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 +247,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-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-build.yml similarity index 98% rename from .github/workflows/release-reusable-rc-buid.yml rename to .github/workflows/release-reusable-rc-build.yml index 1de2053013841..f33c18087e635 100644 --- a/.github/workflows/release-reusable-rc-buid.yml +++ b/.github/workflows/release-reusable-rc-build.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@db473fddc028af60658334401dc6fa3ffd8669fd # v2.3.0 @@ -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@db473fddc028af60658334401dc6fa3ffd8669fd # v2.3.0