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

Use newer docker images for release #38

Merged
merged 1 commit into from
Jan 13, 2023
Merged
Changes from all commits
Commits
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
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)