Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github/workflows: add ARM macos build binaries job #6427

Merged
merged 33 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
1a94ac2
add macos build workflow
iulianbarbu Nov 10, 2024
a4be07a
Merge branch 'master' into ib-enable-arm-binaries
iulianbarbu Nov 10, 2024
e12c5f7
comment x86_64 artifacts building
iulianbarbu Nov 10, 2024
9cf7eb2
fixes up to s3 upload
iulianbarbu Nov 13, 2024
3593e08
add missing omni node job
iulianbarbu Nov 13, 2024
23fe755
Merge branch 'master' into ib-enable-arm-binaries
iulianbarbu Nov 14, 2024
c83c174
install pgpkms using pipx
EgorPopelyaev Nov 14, 2024
0bb53ec
delete which pgpkms
EgorPopelyaev Nov 14, 2024
5e7e8e8
use pgpkms directly
EgorPopelyaev Nov 15, 2024
44d03e8
add pipx ensurepath
EgorPopelyaev Nov 15, 2024
53c99d4
test installation directly in the sign step
EgorPopelyaev Nov 15, 2024
b7c1f91
test
EgorPopelyaev Nov 15, 2024
4994253
test another installation
EgorPopelyaev Nov 15, 2024
ecc698a
clenup
EgorPopelyaev Nov 15, 2024
f87bd2e
add platform to s3 upload
EgorPopelyaev Nov 18, 2024
1941381
fix artifacts upload/download
EgorPopelyaev Nov 18, 2024
915ee38
modify s3 upload steps
EgorPopelyaev Nov 18, 2024
904f345
fix typo
EgorPopelyaev Nov 18, 2024
10bf71c
fix one more typo
EgorPopelyaev Nov 18, 2024
9362987
split builds based on platform
EgorPopelyaev Nov 18, 2024
5c39785
change if conditions
EgorPopelyaev Nov 19, 2024
eeac133
fix wrong s3 url
EgorPopelyaev Nov 19, 2024
c2296d2
Cleanup
EgorPopelyaev Nov 19, 2024
6d6f50a
Merge branch 'master' of https://github.com/paritytech/polkadot-sdk i…
EgorPopelyaev Nov 19, 2024
c5e75a3
Apply suggestions from code review
iulianbarbu Nov 20, 2024
973b7af
Apply suggestions from code review
iulianbarbu Nov 20, 2024
a8cfcad
Apply suggestions from code review
iulianbarbu Nov 20, 2024
6ee1934
release draft: remove duplicated building & publishing of polkadot-om…
iulianbarbu Nov 20, 2024
d149ab6
Merge branch 'master' into ib-enable-arm-binaries
iulianbarbu Nov 20, 2024
75c5758
add missing secret
EgorPopelyaev Nov 20, 2024
2cb63ca
fix macos artifact naming
iulianbarbu Nov 20, 2024
4ef7772
fix binaries upload to S3
iulianbarbu Nov 20, 2024
221a948
Update .github/workflows/release-reusable-rc-buid.yml
iulianbarbu Nov 21, 2024
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 @@ -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`.
iulianbarbu marked this conversation as resolved.
Show resolved Hide resolved
#
# 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.
iulianbarbu marked this conversation as resolved.
Show resolved Hide resolved
# 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"
38 changes: 20 additions & 18 deletions .github/scripts/release/release_lib.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

# Set the new version by replacing the value of the constant given as patetrn
# Set the new version by replacing the value of the constant given as pattern
# in the file.
#
# input: pattern, version, file
Expand Down Expand Up @@ -119,21 +119,23 @@ set_polkadot_parachain_binary_version() {


upload_s3_release() {
alias aws='podman run --rm -it docker.io/paritytech/awscli -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_BUCKET aws'

product=$1
version=$2

echo "Working on product: $product "
echo "Working on version: $version "

echo "Current content, should be empty on new uploads:"
aws s3 ls "s3://releases.parity.io/polkadot/${version}/" --recursive --human-readable --summarize || true
echo "Content to be uploaded:"
artifacts="artifacts/$product/"
ls "$artifacts"
aws s3 sync --acl public-read "$artifacts" "s3://releases.parity.io/polkadot/${version}/"
echo "Uploaded files:"
aws s3 ls "s3://releases.parity.io/polkadot/${version}/" --recursive --human-readable --summarize
echo "✅ The release should be at https://releases.parity.io/polkadot/${version}"
alias aws='podman run --rm -it docker.io/paritytech/awscli -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_BUCKET aws'

product=$1
version=$2
platform=$3
iulianbarbu marked this conversation as resolved.
Show resolved Hide resolved

echo "Working on product: $product "
echo "Working on version: $version "
echo "Working on platform: $platform "
iulianbarbu marked this conversation as resolved.
Show resolved Hide resolved

echo "Current content, should be empty on new uploads:"
aws s3 ls "s3://releases.parity.io/${product}/${version}/${platform}" --recursive --human-readable --summarize || true
iulianbarbu marked this conversation as resolved.
Show resolved Hide resolved
echo "Content to be uploaded:"
artifacts="artifacts/$product/"
ls "$artifacts"
aws s3 sync --acl public-read "$artifacts" "s3://releases.parity.io/${product}/${version}/${platform}"
iulianbarbu marked this conversation as resolved.
Show resolved Hide resolved
echo "Uploaded files:"
aws s3 ls "s3://releases.parity.io/${product}/${version}/${platform}" --recursive --human-readable --summarize
iulianbarbu marked this conversation as resolved.
Show resolved Hide resolved
echo "✅ The release should be at https://releases.parity.io/${product}/${version}/${platform}"
iulianbarbu marked this conversation as resolved.
Show resolved Hide resolved
}
91 changes: 91 additions & 0 deletions .github/workflows/release-build-rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
options:
- polkadot
- polkadot-parachain
- polkadot-omni-node
- all

release_tag:
Expand Down Expand Up @@ -47,6 +48,7 @@ jobs:
binary: '["polkadot", "polkadot-prepare-worker", "polkadot-execute-worker"]'
package: polkadot
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
platform: amd64
iulianbarbu marked this conversation as resolved.
Show resolved Hide resolved
secrets:
PGP_KMS_KEY: ${{ secrets.PGP_KMS_KEY }}
PGP_KMS_HASH: ${{ secrets.PGP_KMS_HASH }}
Expand All @@ -68,6 +70,95 @@ jobs:
binary: '["polkadot-parachain"]'
package: "polkadot-parachain-bin"
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
platform: amd64
iulianbarbu marked this conversation as resolved.
Show resolved Hide resolved
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-omni-node-binary:
needs: [validate-inputs]
if: ${{ inputs.binary == 'polkadot-omni-node' || inputs.binary == 'all' }}
uses: "./.github/workflows/release-reusable-rc-buid.yml"
with:
binary: '["polkadot-omni-node"]'
package: "polkadot-omni-node"
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
platform: amd64
iulianbarbu marked this conversation as resolved.
Show resolved Hide resolved
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]
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 }}
platform: arm
iulianbarbu marked this conversation as resolved.
Show resolved Hide resolved
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-macos-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 }}
platform: arm
iulianbarbu marked this conversation as resolved.
Show resolved Hide resolved
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-omni-node-macos-binary:
needs: [validate-inputs]
if: ${{ inputs.binary == 'polkadot-omni-node' || inputs.binary == 'all' }}
uses: "./.github/workflows/release-reusable-rc-buid.yml"
with:
binary: '["polkadot-omni-node"]'
package: "polkadot-omni-node"
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
platform: arm
iulianbarbu marked this conversation as resolved.
Show resolved Hide resolved
secrets:
PGP_KMS_KEY: ${{ secrets.PGP_KMS_KEY }}
PGP_KMS_HASH: ${{ secrets.PGP_KMS_HASH }}
Expand Down
Loading
Loading