Skip to content

Commit

Permalink
release upload action fix
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-marinica committed Aug 18, 2023
1 parent ed18c51 commit 2130343
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 14 deletions.
40 changes: 33 additions & 7 deletions .github/workflows/release-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,41 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install mxpy
uses: actions/checkout@v3

- name: Install rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
default: true
toolchain: nightly-2023-08-08
target: wasm32-unknown-unknown

- name: Setup the PATH variable
run: |
source .github/workflows/env
pip3 install multiversx-sdk-cli
- name: Install wasm-opt
echo "PATH=$HOME/.local/bin:$HOME/multiversx-sdk/vmtools:$PATH" >> $GITHUB_ENV
- name: Install prerequisites
run: |
mxpy deps install nodejs
mxpy deps install wasm-opt
pip3 install multiversx-sdk-cli==v6.0.0
mkdir $HOME/multiversx-sdk
python3 -m multiversx_sdk_cli.cli deps install vmtools --tag v1.4.60
wget -O binaryen.tar.gz https://github.com/WebAssembly/binaryen/releases/download/version_112/binaryen-version_112-x86_64-linux.tar.gz
tar -xf binaryen.tar.gz
cp binaryen-version_112/bin/wasm-opt $HOME/.local/bin
sudo apt install -y wabt=1.0.27-1
which wasm-opt
which wasm2wat
which run-scenarios
- name: Install libtinfo5
if: inputs.install-libtinfo5
run: |
sudo apt update
sudo apt install -y libtinfo5
- name: Build project example outputs
run: |
./zip-example-wasm.sh
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/template-test-current.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ jobs:
name: Template tool test - current (unreleased) templates
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v3

- name: Install rust
uses: actions-rust-lang/setup-rust-toolchain@v1
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/template-test-released.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ jobs:
name: Template tool test - released templates
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v3

- name: Install rust
uses: actions-rust-lang/setup-rust-toolchain@v1
Expand Down
9 changes: 4 additions & 5 deletions zip-example-wasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@
## Used in generating an output artefact for each elrond-wasm release.

ZIP_OUTPUT="examples-wasm.zip"
TARGET_DIR=$PWD/target
cargo install multiversx-sc-meta

# start fresh
rm -f $ZIP_OUTPUT

set -e
sc-meta all build --target-dir-wasm $TARGET_DIR --path ./contracts/examples || return 1

SMART_CONTRACT_JSONS=$(find contracts/examples -name "multiversx.json")
for smart_contract_json in $SMART_CONTRACT_JSONS
do
smart_contract_folder=$(dirname $smart_contract_json)
echo ""
# build example wasm + ABI
rm -rf $smart_contract_folder/output
(set -x; mxpy --verbose contract build $smart_contract_folder)

# add to zip
zip -ur --junk-paths $ZIP_OUTPUT $smart_contract_folder/output
Expand Down

0 comments on commit 2130343

Please sign in to comment.