Skip to content

Commit

Permalink
add upload-to-s3 step
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorPopelyaev committed Nov 21, 2024
1 parent 105cc31 commit 770d84d
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 10 deletions.
22 changes: 22 additions & 0 deletions .github/scripts/release/release_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,25 @@ upload_s3_release() {
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}"
}

# 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}"
}
38 changes: 28 additions & 10 deletions .github/workflows/release-21_build-runtimes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,31 @@ jobs:
build_opts: "--features on-chain-release-build"
profile: production

# upload-to-s3:
# needs: [build-runtimes]
# uses: ./.github/workflows/release-reusable-s3-upload.yml
# with:
# package: polkadot
# release_tag: ${{ needs.validate-inputs.outputs.release_tag }}
# secrets:
# 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 }}
upload-to-s3:
runs-on: ubuntu-latest
environment: release
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_RELEASE_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_RELEASE_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_DEFAULT_REGION }}

steps:
- name: Checkout
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0

- name: Download artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
path: artifacts/runtimes

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
with:
aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}

- name: Upload runtimes artifacts to s3
run: |
. ./.github/scripts/release/release_lib.sh
upload_s3_runtimes_release_artifacts ${{ inputs.release_tag }}

0 comments on commit 770d84d

Please sign in to comment.