diff --git a/.github/workflows/build-node-and-runtime.yml b/.github/workflows/build-node-and-runtime.yml index a34e6b1856..3cfe155af0 100644 --- a/.github/workflows/build-node-and-runtime.yml +++ b/.github/workflows/build-node-and-runtime.yml @@ -12,7 +12,6 @@ on: required: false type: string - jobs: build: name: Build binary artifacts @@ -25,6 +24,10 @@ jobs: with: ref: ${{ inputs.ref }} + - name: Get branch name and commit SHA + id: get_branch + uses: ./.github/actions/get-branch + - name: Install Rust toolchain uses: actions-rs/toolchain@v1 @@ -61,6 +64,37 @@ jobs: if-no-files-found: error retention-days: 7 + - name: S3 CI | Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + env: + AWS_REGION: us-east-1 + with: + aws-access-key-id: ${{ secrets.AWS_MAINNET_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_MAINNET_SECRET_ACCESS_KEY }} + aws-region: ${{ env.AWS_REGION }} + + - name: S3 CI | Copy release binary to S3 bucket + shell: bash + env: + BINARY_DIR: target/production + BINARY_FILE: aleph-node + S3BUCKET_URL: s3://${{ secrets.CI_MAINNET_S3BUCKET_NAME }}/builds/aleph-node/commits/${{ steps.get_branch.outputs.sha_short }}/aleph-node + S3BUCKET_FILE: aleph-node-${{ steps.get_branch.outputs.sha_short }}.tar.gz + run: | + tar -cvzf ${{ env.S3BUCKET_FILE }} -C ${{ env.BINARY_DIR }} ${{ env.BINARY_FILE }} + aws s3 cp ${{ env.S3BUCKET_FILE }} ${{ env.S3BUCKET_URL }}/${{ env.S3BUCKET_FILE }} + + - name: S3 CI | Copy release runtime to S3 bucket + shell: bash + env: + BINARY_DIR: target/production/wbuild/aleph-runtime + BINARY_FILE: aleph_runtime.compact.wasm + S3BUCKET_URL: s3://${{ secrets.CI_MAINNET_S3BUCKET_NAME }}/builds/aleph-node/commits/${{ steps.get_branch.outputs.sha_short }}/aleph-runtime + S3BUCKET_FILE: aleph-runtime-${{ steps.get_branch.outputs.sha_short }}.tar.gz + run: | + tar -cvzf ${{ env.S3BUCKET_FILE }} -C ${{ env.BINARY_DIR }} ${{ env.BINARY_FILE }} + aws s3 cp ${{ env.S3BUCKET_FILE }} ${{ env.S3BUCKET_URL }}/${{ env.S3BUCKET_FILE }} + - name: Build test binary run: cargo build --release -p aleph-node --features "short_session enable_treasury_proposals only_legacy" @@ -80,5 +114,27 @@ jobs: if-no-files-found: error retention-days: 7 + - name: S3 CI | Copy test binary to S3 bucket + shell: bash + env: + BINARY_DIR: target/release + BINARY_FILE: aleph-node + S3BUCKET_URL: s3://${{ secrets.CI_MAINNET_S3BUCKET_NAME }}/builds/aleph-node/commits/${{ steps.get_branch.outputs.sha_short }}/aleph-test-node + S3BUCKET_FILE: aleph-test-node-${{ steps.get_branch.outputs.sha_short }}.tar.gz + run: | + tar -cvzf ${{ env.S3BUCKET_FILE }} -C ${{ env.BINARY_DIR }} ${{ env.BINARY_FILE }} + aws s3 cp ${{ env.S3BUCKET_FILE }} ${{ env.S3BUCKET_URL }}/${{ env.S3BUCKET_FILE }} + + - name: S3 CI | Copy test runtime to S3 bucket + shell: bash + env: + BINARY_DIR: target/release/wbuild/aleph-runtime + BINARY_FILE: aleph_runtime.compact.wasm + S3BUCKET_URL: s3://${{ secrets.CI_MAINNET_S3BUCKET_NAME }}/builds/aleph-node/commits/${{ steps.get_branch.outputs.sha_short }}/aleph-test-runtime + S3BUCKET_FILE: aleph-test-runtime-${{ steps.get_branch.outputs.sha_short }}.tar.gz + run: | + tar -cvzf ${{ env.S3BUCKET_FILE }} -C ${{ env.BINARY_DIR }} ${{ env.BINARY_FILE }} + aws s3 cp ${{ env.S3BUCKET_FILE }} ${{ env.S3BUCKET_URL }}/${{ env.S3BUCKET_FILE }} + - name: Cleanup cache uses: ./.github/actions/post-cache diff --git a/.github/workflows/deploy-feature-envs.yaml b/.github/workflows/deploy-feature-envs.yaml index 1886dce81f..b16b7fb80e 100644 --- a/.github/workflows/deploy-feature-envs.yaml +++ b/.github/workflows/deploy-feature-envs.yaml @@ -31,6 +31,7 @@ jobs: if: (github.event.label.name == '[AZERO] DEPLOY-FEATURE-ENV') || (github.event.label.name == '[AZERO] DEPLOY-HOT-FEATURE-ENV') name: Build runtime and aleph-node binary artefacts uses: ./.github/workflows/build-node-and-runtime.yml + secrets: inherit push_pr_image: if: (github.event.label.name == '[AZERO] DEPLOY-FEATURE-ENV') || (github.event.label.name == '[AZERO] DEPLOY-HOT-FEATURE-ENV') diff --git a/.github/workflows/deploy-mainnet.yml b/.github/workflows/deploy-mainnet.yml index fdff14f645..c63e1cc4ba 100644 --- a/.github/workflows/deploy-mainnet.yml +++ b/.github/workflows/deploy-mainnet.yml @@ -72,6 +72,30 @@ jobs: docker push ${{ env.DOCKERHUB_MAINNET_IMAGE }} docker push ${{ env.DOCKERHUB_MAINNET_LATEST_IMAGE }} + - name: S3 CI | Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + env: + AWS_REGION: us-east-1 + with: + aws-access-key-id: ${{ secrets.AWS_MAINNET_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_MAINNET_SECRET_ACCESS_KEY }} + aws-region: ${{ env.AWS_REGION }} + + - name: S3 CI | Download release runtime from S3 bucket + shell: bash + env: + S3BUCKET_URL: s3://${{ secrets.CI_MAINNET_S3BUCKET_NAME }}/builds/aleph-node/commits/${{ steps.get_branch.outputs.sha_short }}/aleph-runtime + S3BUCKET_FILE: aleph-runtime-${{ steps.get_branch.outputs.sha_short }}.tar.gz + run: | + aws s3 cp ${{ env.S3BUCKET_URL }}/${{ S3BUCKET_FILE }} ${{ env.S3BUCKET_FILE }} + + - name: RELEASE ASSET | Add runtime to the release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + aleph-runtime-${{ steps.get_branch.outputs.sha_short }}.tar.gz + - name: GIT | Checkout aleph-apps repo uses: actions/checkout@master with: diff --git a/.github/workflows/deploy-testnet.yml b/.github/workflows/deploy-testnet.yml index d5e108431d..827ae6d7da 100644 --- a/.github/workflows/deploy-testnet.yml +++ b/.github/workflows/deploy-testnet.yml @@ -79,6 +79,30 @@ jobs: docker push ${{ env.DOCKERHUB_TESTNET_IMAGE }} docker push ${{ env.DOCKERHUB_TESTNET_LATEST_IMAGE }} + - name: S3 CI | Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + env: + AWS_REGION: us-east-1 + with: + aws-access-key-id: ${{ secrets.AWS_DEVNET_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_DEVNET_SECRET_ACCESS_KEY }} + aws-region: ${{ env.AWS_REGION }} + + - name: S3 CI | Download release runtime from S3 bucket + shell: bash + env: + S3BUCKET_URL: s3://${{ secrets.CI_MAINNET_S3BUCKET_NAME }}/builds/aleph-node/commits/${{ steps.get_branch.outputs.sha_short }}/aleph-runtime + S3BUCKET_FILE: aleph-runtime-${{ steps.get_branch.outputs.sha_short }}.tar.gz + run: | + aws s3 cp ${{ env.S3BUCKET_URL }}/${{ S3BUCKET_FILE }} ${{ env.S3BUCKET_FILE }} + + - name: RELEASE ASSET | Add runtime to the release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + aleph-runtime-${{ steps.get_branch.outputs.sha_short }}.tar.gz + - name: GIT | Checkout aleph-apps repo uses: actions/checkout@master with: diff --git a/.github/workflows/e2e-tests-main-devnet.yml b/.github/workflows/e2e-tests-main-devnet.yml index 1dab717e3b..63ee5476c7 100644 --- a/.github/workflows/e2e-tests-main-devnet.yml +++ b/.github/workflows/e2e-tests-main-devnet.yml @@ -23,6 +23,7 @@ jobs: build-new-node: name: Build node and runtime artifacts (PR version) uses: ./.github/workflows/build-node-and-runtime.yml + secrets: inherit build-test-docker: needs: [build-new-node] diff --git a/.github/workflows/nightly-pipeline.yaml b/.github/workflows/nightly-pipeline.yaml index 25ee16ca50..fe47743973 100644 --- a/.github/workflows/nightly-pipeline.yaml +++ b/.github/workflows/nightly-pipeline.yaml @@ -12,6 +12,7 @@ jobs: build-new-node: name: Build node and runtime artifacts (PR version) uses: ./.github/workflows/build-node-and-runtime.yml + secrets: inherit build-test-docker: needs: [build-new-node]