Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/scripts/release/build-linux-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"

Expand Down
22 changes: 12 additions & 10 deletions .github/workflows/release-20_build-rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand All @@ -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 }}
Expand All @@ -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"
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 }}
Expand All @@ -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
Expand All @@ -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
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/release-build-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading