Skip to content

Feat: Polkadot v1.7 to v1.8 upgrade #463

Feat: Polkadot v1.7 to v1.8 upgrade

Feat: Polkadot v1.7 to v1.8 upgrade #463

Workflow file for this run

name: Release to stage
on:
push:
branches:
- new-dev
- new-staging
- master
- 'release/**'
- 'hotfix/**'
env:
PROFILE: release
jobs:
build:
runs-on: ubuntu-latest
concurrency: dev
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v3
- name: Cache cargo registry
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::${{ vars.DEV_NETWORK_AWS_ACCOUNT_ID }}:role/github
role-session-name: ${{ github.event.repository.name }}
aws-region: us-west-2
- name: Confiure environment variables
run: |
echo "GITHUB_SHA=${GITHUB_SHA:0:7}" >> ${GITHUB_ENV}
echo "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}" >> ${GITHUB_ENV}
echo "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}" >> ${GITHUB_ENV}
echo "AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN}" >> ${GITHUB_ENV}
echo "CERE_RUNTIME=cere_runtime.compact.compressed.${GITHUB_SHA:0:7}.wasm" >> ${GITHUB_ENV}
echo "CERE_DEV_RUNTIME=cere_dev_runtime.compact.compressed.${GITHUB_SHA:0:7}.wasm" >> ${GITHUB_ENV}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Install toolchain and rust-src
uses: actions-rs/toolchain@v1
with:
toolchain: 1.79.0
override: true
target: wasm32-unknown-unknown
components: rust-src
- name: Build and push docker image to ECR
uses: docker/build-push-action@v4
with:
context: .
push: true
build-args: |
"AWS_ACCESS_KEY_ID=${{ env.AWS_ACCESS_KEY_ID }}"
"AWS_SECRET_ACCESS_KEY=${{ env.AWS_SECRET_ACCESS_KEY }}"
"AWS_SESSION_TOKEN=${{ env.AWS_SESSION_TOKEN }}"
"SCCACHE_REGION=us-west-2"
"SCCACHE_BUCKET=cere-blockchain-sccache"
tags: |
${{ steps.login-ecr.outputs.registry }}/pos-network-node:${{ github.sha }}
${{ steps.login-ecr.outputs.registry }}/pos-network-node:${{ env.GITHUB_SHA }}
${{ steps.login-ecr.outputs.registry }}/pos-network-node:dev-latest
- name: Copy wasm artifacts from the image
run: |
CONTAINER_ID=$(docker create ${{ steps.login-ecr.outputs.registry }}/pos-network-node:${{ env.GITHUB_SHA }})
docker cp "${CONTAINER_ID}:/home/cere/cere-runtime-artifacts/cere_runtime.compact.compressed.wasm" "./${{ env.CERE_RUNTIME }}"
docker cp "${CONTAINER_ID}:/home/cere/cere-dev-runtime-artifacts/cere_dev_runtime.compact.compressed.wasm" "./${{ env.CERE_DEV_RUNTIME }}"
- name: Upload cere-runtime wasm artifact
uses: actions/upload-artifact@v3
with:
name: "cere_runtime.compact.compressed.${{ env.GITHUB_SHA }}.wasm"
path: "./${{ env.CERE_RUNTIME }}"
- name: Upload cere-dev-runtime wasm artifact
uses: actions/upload-artifact@v3
with:
name: "cere_dev_runtime.compact.compressed.${{ env.GITHUB_SHA }}.wasm"
path: "./${{ env.CERE_DEV_RUNTIME }}"
trigger-e2e-tests:
runs-on: ubuntu-latest
needs: build
steps:
- name: 'Trigger e2e DDC tests'
uses: convictional/trigger-workflow-and-wait@v1.6.5
with:
owner: Cerebellum-Network
repo: ddc-api-e2e-simulations
github_token: ${{ secrets.GH_E2E_TOKEN }}
comment_github_token: ${{ secrets.GH_E2E_TOKEN }}
github_user: devops-cere
workflow_file_name: run-simulations-env-local-triggered.yml
client_payload: |-
{
"POS_NODE_VERSION": "master-latest"
}
ref: master
propagate_failure: false
trigger_workflow: true
wait_workflow: false
comment_downstream_url: ${{ github.event.pull_request.comments_url }}