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

[Release/CICD] Re-worked Create Release Draft flow #6734

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
a8e7c09
add pipeline to build runtimes
EgorPopelyaev Nov 14, 2024
622c02e
Merge branch 'master' of https://github.com/paritytech/polkadot-sdk i…
EgorPopelyaev Nov 21, 2024
b5c6e64
add profile
EgorPopelyaev Nov 21, 2024
105cc31
exclude trigger on push
EgorPopelyaev Nov 21, 2024
770d84d
add upload-to-s3 step
EgorPopelyaev Nov 21, 2024
b42f396
add needs to upload
EgorPopelyaev Nov 21, 2024
a44f177
Merge branch 'master' of https://github.com/paritytech/polkadot-sdk i…
EgorPopelyaev Nov 26, 2024
dba69fe
fix s3 url
EgorPopelyaev Nov 26, 2024
fa272e0
Merge branch 'master' of https://github.com/paritytech/polkadot-sdk i…
EgorPopelyaev Nov 26, 2024
236d634
test download from s3 and release upload
EgorPopelyaev Nov 27, 2024
7c8b19d
add checkout step
EgorPopelyaev Nov 27, 2024
e0ef0b6
test
EgorPopelyaev Nov 27, 2024
d69580b
rename macos bins
EgorPopelyaev Nov 27, 2024
1f6a3a0
test separate upload
EgorPopelyaev Nov 27, 2024
d63787b
adjust upload for all assets
EgorPopelyaev Nov 27, 2024
ea35049
add environment
EgorPopelyaev Nov 27, 2024
973cfd9
fix typo
EgorPopelyaev Nov 27, 2024
e58e55d
face prdoc release to test
EgorPopelyaev Nov 27, 2024
acfb046
adjust sed to filter out version for draft
EgorPopelyaev Nov 27, 2024
df68e9e
trying with just a repo name
EgorPopelyaev Nov 27, 2024
0b606c6
add repo to tokne generation
EgorPopelyaev Nov 28, 2024
52728e9
use gh to create draft
EgorPopelyaev Nov 28, 2024
8bea61e
fix paths to artefacts
EgorPopelyaev Nov 28, 2024
8f4575a
cleanup and rename
EgorPopelyaev Nov 28, 2024
fe3bb87
Merge branch 'master' of https://github.com/paritytech/polkadot-sdk i…
EgorPopelyaev Nov 28, 2024
b5204df
add attestation
EgorPopelyaev Nov 28, 2024
ecdfea6
move bins build from create draft to rc build
EgorPopelyaev Nov 28, 2024
b3af8d7
fix chain-spec-builder build
EgorPopelyaev Nov 28, 2024
a2a4fc5
adjust flows
EgorPopelyaev Nov 29, 2024
6668bb4
add s3 upload for chainspec-builder and omni-bencher
EgorPopelyaev Nov 29, 2024
47a546e
adjust docke build flow
EgorPopelyaev Nov 29, 2024
f8f7f9a
test without release id
EgorPopelyaev Nov 29, 2024
c364deb
add missing upload step
EgorPopelyaev Nov 29, 2024
5bf19bd
fix working dir
EgorPopelyaev Nov 29, 2024
3dca41b
fix tag
EgorPopelyaev Nov 29, 2024
efe1f1a
use bash shell
EgorPopelyaev Nov 29, 2024
c48bb54
simplify one of the tags
EgorPopelyaev Nov 29, 2024
89d0520
fix typo in upload
EgorPopelyaev Nov 29, 2024
e80954e
fix fetch_s3 functions
EgorPopelyaev Nov 30, 2024
3c52f61
rename prdocs folder to test
EgorPopelyaev Nov 30, 2024
eda6838
test release polka
EgorPopelyaev Nov 30, 2024
3e3eb4b
fix fetch values
EgorPopelyaev Nov 30, 2024
2a12a36
add frame-omni-bencher to fetch_s3
EgorPopelyaev Nov 30, 2024
237c1ad
add execute and prepare workers to draft
EgorPopelyaev Nov 30, 2024
e4c93e0
clean up
EgorPopelyaev Dec 2, 2024
8eec87e
Merge branch 'master' of https://github.com/paritytech/polkadot-sdk i…
EgorPopelyaev Dec 2, 2024
6e4ecde
re-name pipeline
EgorPopelyaev Dec 2, 2024
89bd9bd
move back prdoc
EgorPopelyaev Dec 2, 2024
83a1974
add check sync to the docker flow
EgorPopelyaev Dec 2, 2024
650de8c
clean up
EgorPopelyaev Dec 2, 2024
07686fd
Merge branch 'master' of https://github.com/paritytech/polkadot-sdk i…
EgorPopelyaev Dec 3, 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
45 changes: 34 additions & 11 deletions .github/scripts/common/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -270,20 +270,19 @@ fetch_debian_package_from_s3() {
}

# Fetch the release artifacts like binary and signatures from S3. Assumes the ENV are set:
# - RELEASE_ID
# - GITHUB_TOKEN
# - REPO in the form paritytech/polkadot
# inputs: binary (polkadot), target(aarch64-apple-darwin)
fetch_release_artifacts_from_s3() {
BINARY=$1
OUTPUT_DIR=${OUTPUT_DIR:-"./release-artifacts/${BINARY}"}
TARGET=$2
OUTPUT_DIR=${OUTPUT_DIR:-"./release-artifacts/${TARGET}/${BINARY}"}
echo "OUTPUT_DIR : $OUTPUT_DIR"

URL_BASE=$(get_s3_url_base $BINARY)
echo "URL_BASE=$URL_BASE"

URL_BINARY=$URL_BASE/$VERSION/$BINARY
URL_SHA=$URL_BASE/$VERSION/$BINARY.sha256
URL_ASC=$URL_BASE/$VERSION/$BINARY.asc
URL_BINARY=$URL_BASE/$VERSION/$TARGET/$BINARY
URL_SHA=$URL_BASE/$VERSION/$TARGET/$BINARY.sha256
URL_ASC=$URL_BASE/$VERSION/$TARGET/$BINARY.asc

# Fetch artifacts
mkdir -p "$OUTPUT_DIR"
Expand All @@ -306,15 +305,26 @@ fetch_release_artifacts_from_s3() {
function get_s3_url_base() {
name=$1
case $name in
polkadot | polkadot-execute-worker | polkadot-prepare-worker | staking-miner)
polkadot | polkadot-execute-worker | polkadot-prepare-worker )
printf "https://releases.parity.io/polkadot"
;;

polkadot-parachain)
printf "https://releases.parity.io/cumulus"
polkadot-parachain)
printf "https://releases.parity.io/polkadot-parachain"
;;

polkadot-omni-node)
printf "https://releases.parity.io/polkadot-omni-node"
;;

chain-spec-builder)
printf "https://releases.parity.io/chain-spec-builder"
;;

*)
frame-omni-bencher)
printf "https://releases.parity.io/frame-omni-bencher"
;;
*)
printf "UNSUPPORTED BINARY $name"
exit 1
;;
Expand Down Expand Up @@ -497,3 +507,16 @@ validate_stable_tag() {
exit 1
fi
}

# Prepare docker stable tag form the polkadot stable tag
# input: tag (polkaodot-stableYYMM(-X) or polkadot-stableYYMM(-X)-rcX)
# output: stableYYMM(-X) or stableYYMM(-X)-rcX
prepare_docker_stable_tag() {
tag="$1"
if [[ "$tag" =~ stable[0-9]{4}(-[0-9]+)?(-rc[0-9]+)? ]]; then
echo "${BASH_REMATCH[0]}"
else
echo "Tag is invalid: $tag"
exit 1
fi
}
22 changes: 22 additions & 0 deletions .github/scripts/release/release_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,25 @@ upload_s3_release() {
aws s3 ls "s3://releases.parity.io/${product}/${version}/${target}" --recursive --human-readable --summarize
echo "✅ The release should be at https://releases.parity.io/${product}/${version}/${target}"
}

# Upload runtimes artifacts to s3 release bucket
#
# input: version (stable release tage.g. polkadot-stable2412 or polkadot-stable2412-rc1)
# output: none
upload_s3_runtimes_release_artifacts() {
alias aws='podman run --rm -it docker.io/paritytech/awscli -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_BUCKET aws'

version=$1

echo "Working on version: $version "

echo "Current content, should be empty on new uploads:"
aws s3 ls "s3://releases.parity.io/polkadot/runtimes/${version}/" --recursive --human-readable --summarize || true
echo "Content to be uploaded:"
artifacts="artifacts/runtimes/"
ls "$artifacts"
aws s3 sync --acl public-read "$artifacts" "s3://releases.parity.io/polkadot/runtimes/${version}/"
echo "Uploaded files:"
aws s3 ls "s3://releases.parity.io/polkadot/runtimes/${version}/" --recursive --human-readable --summarize
echo "✅ The release should be at https://releases.parity.io/polkadot/runtimes/${version}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ on:
- polkadot
- polkadot-parachain
- polkadot-omni-node
- frame-omni-bencher
- chain-spec-builder
- all

release_tag:
description: Tag matching the actual release candidate with the format stableYYMM-rcX or stableYYMM
description: Tag matching the actual release candidate with the format polkadot-stableYYMM(-X)-rcX or polkadot-stableYYMM(-X)
type: string

jobs:
Expand Down Expand Up @@ -106,6 +108,50 @@ jobs:
attestations: write
contents: read

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"
with:
binary: '["frame-omni-bencher"]'
package: "frame-omni-bencher"
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
target: x86_64-unknown-linux-gnu
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-chain-spec-builder-binary:
needs: [validate-inputs]
if: ${{ inputs.binary == 'chain-spec-builder' || inputs.binary == 'all' }}
uses: "./.github/workflows/release-reusable-rc-buid.yml"
with:
binary: '["chain-spec-builder"]'
package: staging-chain-spec-builder
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
target: x86_64-unknown-linux-gnu
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' }}
Expand Down Expand Up @@ -134,7 +180,7 @@ jobs:
uses: "./.github/workflows/release-reusable-rc-buid.yml"
with:
binary: '["polkadot-parachain"]'
package: "polkadot-parachain-bin"
package: polkadot-parachain-bin
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
target: aarch64-apple-darwin
secrets:
Expand All @@ -156,7 +202,51 @@ jobs:
uses: "./.github/workflows/release-reusable-rc-buid.yml"
with:
binary: '["polkadot-omni-node"]'
package: "polkadot-omni-node"
package: polkadot-omni-node
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
target: aarch64-apple-darwin
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-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"
with:
binary: '["frame-omni-bencher"]'
package: frame-omni-bencher
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
target: aarch64-apple-darwin
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-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"
with:
binary: '["chain-spec-builder"]'
package: staging-chain-spec-builder
release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
target: aarch64-apple-darwin
secrets:
Expand Down
Loading
Loading