Skip to content

Commit

Permalink
fixes up to s3 upload
Browse files Browse the repository at this point in the history
Signed-off-by: Iulian Barbu <[email protected]>
  • Loading branch information
iulianbarbu committed Nov 13, 2024
1 parent e12c5f7 commit 9cf7eb2
Show file tree
Hide file tree
Showing 4 changed files with 241 additions and 158 deletions.
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 @@ -3,6 +3,11 @@
# This is used to build our binaries:
# - polkadot
# - polkadot-parachain
# - polkadot-omni-node is not built by this script, but it is built as part of
# `release-30_publish_release_draft.yml`, along other binaries like `frame-omni-bencher`,
# or `staging-chain-spec-builder`. The plan is to unify the building of all binaries within
# a single workflow. Currently this script is used in `release-reusable-rc-build.yml`.
#
# set -e

BIN=$1
Expand All @@ -21,7 +26,7 @@ time cargo build --profile $PROFILE --locked --verbose --bin $BIN --package $PAC
echo "Artifact target: $ARTIFACTS"

cp ./target/$PROFILE/$BIN "$ARTIFACTS"
pushd "$ARTIFACTS" > /dev/nul
pushd "$ARTIFACTS" > /dev/null
sha256sum "$BIN" | tee "$BIN.sha256"

EXTRATAG="$($ARTIFACTS/$BIN --version |
Expand Down
40 changes: 40 additions & 0 deletions .github/scripts/release/build-macos-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env bash

# This is used to build our binaries:
# - polkadot
# - polkadot-parachain
# - polkadot-omni-node (the x86_64 linux version is built as part of
# `release-30_publish_release_draft.yml`). This script is used in
# `release_reusable-rc-build.yml`, but the plan is to build all the
# macOS ARM64/x86_64 Linux binaries in a single workflow.
# set -e

BIN=$1
PACKAGE=${2:-$BIN}

PROFILE=${PROFILE:-production}
# parity-macos runner needs a path where it can
# write, so make it relative to github workspace.
ARTIFACTS=$GITHUB_WORKSPACE/artifacts/$BIN
VERSION=$(git tag -l --contains HEAD | grep -E "^v.*")

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

echo "Artifact target: $ARTIFACTS"

cp ./target/$PROFILE/$BIN "$ARTIFACTS"
pushd "$ARTIFACTS" > /dev/null
sha256sum "$BIN" | tee "$BIN.sha256"

EXTRATAG="$($ARTIFACTS/$BIN --version |
sed -n -r 's/^'$BIN' ([0-9.]+.*-[0-9a-f]{7,13})-.*$/\1/p')"

EXTRATAG="${VERSION}-${EXTRATAG}-$(cut -c 1-8 $ARTIFACTS/$BIN.sha256)"

echo "$BIN version = ${VERSION} (EXTRATAG = ${EXTRATAG})"
echo -n ${VERSION} > "$ARTIFACTS/VERSION"
echo -n ${EXTRATAG} > "$ARTIFACTS/EXTRATAG"
84 changes: 41 additions & 43 deletions .github/workflows/release-build-rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,47 +39,47 @@ jobs:
RELEASE_TAG=$(validate_stable_tag ${{ inputs.release_tag }})
echo "release_tag=${RELEASE_TAG}" >> $GITHUB_OUTPUT
# build-polkadot-binary:
# needs: [validate-inputs]
# if: ${{ inputs.binary == 'polkadot' || inputs.binary == 'all' }}
# uses: "./.github/workflows/release-reusable-rc-buid.yml"
# with:
# binary: '["polkadot", "polkadot-prepare-worker", "polkadot-execute-worker"]'
# package: polkadot
# release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
# secrets:
# PGP_KMS_KEY: ${{ secrets.PGP_KMS_KEY }}
# PGP_KMS_HASH: ${{ secrets.PGP_KMS_HASH }}
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
# AWS_RELEASE_ACCESS_KEY_ID: ${{ secrets.AWS_RELEASE_ACCESS_KEY_ID }}
# AWS_RELEASE_SECRET_ACCESS_KEY: ${{ secrets.AWS_RELEASE_SECRET_ACCESS_KEY }}
# permissions:
# id-token: write
# attestations: write
# contents: read
#
# build-polkadot-parachain-binary:
# needs: [validate-inputs]
# if: ${{ inputs.binary == 'polkadot-parachain' || inputs.binary == 'all' }}
# uses: "./.github/workflows/release-reusable-rc-buid.yml"
# with:
# binary: '["polkadot-parachain"]'
# package: "polkadot-parachain-bin"
# release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
# secrets:
# PGP_KMS_KEY: ${{ secrets.PGP_KMS_KEY }}
# PGP_KMS_HASH: ${{ secrets.PGP_KMS_HASH }}
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
# AWS_RELEASE_ACCESS_KEY_ID: ${{ secrets.AWS_RELEASE_ACCESS_KEY_ID }}
# AWS_RELEASE_SECRET_ACCESS_KEY: ${{ secrets.AWS_RELEASE_SECRET_ACCESS_KEY }}
# permissions:
# id-token: write
# attestations: write
# contents: read
build-polkadot-binary:
needs: [validate-inputs]
if: ${{ inputs.binary == 'polkadot' || inputs.binary == 'all' }}
uses: "./.github/workflows/release-reusable-rc-buid.yml"
with:
binary: '["polkadot", "polkadot-prepare-worker", "polkadot-execute-worker"]'
package: polkadot
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
secrets:
PGP_KMS_KEY: ${{ secrets.PGP_KMS_KEY }}
PGP_KMS_HASH: ${{ secrets.PGP_KMS_HASH }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
AWS_RELEASE_ACCESS_KEY_ID: ${{ secrets.AWS_RELEASE_ACCESS_KEY_ID }}
AWS_RELEASE_SECRET_ACCESS_KEY: ${{ secrets.AWS_RELEASE_SECRET_ACCESS_KEY }}
permissions:
id-token: write
attestations: write
contents: read

build-polkadot-parachain-binary:
needs: [validate-inputs]
if: ${{ inputs.binary == 'polkadot-parachain' || inputs.binary == 'all' }}
uses: "./.github/workflows/release-reusable-rc-buid.yml"
with:
binary: '["polkadot-parachain"]'
package: "polkadot-parachain-bin"
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
secrets:
PGP_KMS_KEY: ${{ secrets.PGP_KMS_KEY }}
PGP_KMS_HASH: ${{ secrets.PGP_KMS_HASH }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
AWS_RELEASE_ACCESS_KEY_ID: ${{ secrets.AWS_RELEASE_ACCESS_KEY_ID }}
AWS_RELEASE_SECRET_ACCESS_KEY: ${{ secrets.AWS_RELEASE_SECRET_ACCESS_KEY }}
permissions:
id-token: write
attestations: write
contents: read

build-polkadot-macos-binary:
needs: [validate-inputs]
Expand All @@ -89,7 +89,6 @@ jobs:
binary: '["polkadot", "polkadot-prepare-worker", "polkadot-execute-worker"]'
package: polkadot
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
runs_on: parity-macos
secrets:
PGP_KMS_KEY: ${{ secrets.PGP_KMS_KEY }}
PGP_KMS_HASH: ${{ secrets.PGP_KMS_HASH }}
Expand All @@ -111,7 +110,6 @@ jobs:
binary: '["polkadot-parachain"]'
package: "polkadot-parachain-bin"
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
runs_on: parity-macos
secrets:
PGP_KMS_KEY: ${{ secrets.PGP_KMS_KEY }}
PGP_KMS_HASH: ${{ secrets.PGP_KMS_HASH }}
Expand Down
Loading

0 comments on commit 9cf7eb2

Please sign in to comment.