Skip to content

Commit

Permalink
Merge pull request #38 from multiversx/use-new-docker-image-13
Browse files Browse the repository at this point in the history
Use newer docker images for release
  • Loading branch information
andreibancioiu committed Jan 13, 2023
2 parents 6a8a87e + 0848b31 commit 40c35c1
Showing 1 changed file with 25 additions and 26 deletions.
51 changes: 25 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,42 @@ on:
title:
required: true
description: Release title
image_tag:
type: choice
required: true
description: Image multiversx/sdk-rust-contract-builder
options:
- v3.1.0
- v4.0.2
- v4.0.3

permissions:
contents: write

env:
# https://github.com/actions/runner/issues/863 ($HOME is overridden for containers)
ELROND_HOME: /home/elrond
REPO_PATH: /home/elrond/sc-nft-marketplace
REPO_URL: https://github.com/ElrondNetwork/sc-nft-marketplace.git

jobs:
build:
runs-on: ubuntu-latest
# See: https://docs.github.com/en/actions/using-jobs/running-jobs-in-a-container
container:
image: elrondnetwork/elrond-sdk-erdpy-rust:frozen-003
steps:
# We don't use actions/checkout, since we want to control the location of the repository,
# in order to achieve deterministic builds.
- name: Check out code
run: |
echo "Cloning ref: $GITHUB_REF_NAME"
cd $ELROND_HOME && git clone $REPO_URL --branch=$GITHUB_REF_NAME --depth=1
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ env.GITHUB_REF_NAME }}
fetch-depth: 0
repository: ${{ env.GITHUB_REPOSITORY }}

- name: Build WASM files
- name: Download build script
run: |
# Setting $HOME is required by erdpy.
export HOME=$ELROND_HOME
cd $REPO_PATH && bash ./build-wasm.sh
wget https://raw.githubusercontent.com/multiversx/mx-sdk-rust-contract-builder/${{ github.event.inputs.image_tag }}/build_with_docker.py
- name: Build contract
run: |
python3 ./build_with_docker.py --no-docker-tty --image=multiversx/sdk-rust-contract-builder:${{ github.event.inputs.image_tag }} --project=. --output=/home/runner/work/output-from-docker
- name: Save artifacts
uses: actions/upload-artifact@v2
with:
name: built-contracts
path: |
${{ env.REPO_PATH }}/**/output/*.wasm
${{ env.REPO_PATH }}/**/output/*.abi.json
/home/runner/work/output-from-docker/**/*.wasm
/home/runner/work/output-from-docker/**/*.abi.json
if-no-files-found: error

release:
Expand All @@ -66,15 +65,15 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "## Checksums (blake2b):" >> notes.txt
echo "Built using Docker image: **multiversx/sdk-rust-contract-builder:${{ github.event.inputs.image_tag }}**." >> notes.txt
echo "" >> notes.txt
for i in $(find ./assets -type f); do
echo "## Codehash (blake2b):" >> notes.txt
echo "" >> notes.txt
for i in $(find ./assets -type f -name *.wasm); do
filename=$(basename ${i})
checksum=($(b2sum -l 256 ${i}))
echo " - **${filename}**: \`${checksum}\`" >> notes.txt
done
gh release create ${{ github.event.inputs.tag }} --target=$GITHUB_SHA --prerelease --title="${{ github.event.inputs.title }}" --generate-notes --notes-file=notes.txt
sleep 10
gh release upload ${{ github.event.inputs.tag }} $(find ./assets -type f)

0 comments on commit 40c35c1

Please sign in to comment.