Skip to content

Commit

Permalink
CI Using binaries from EVMC release
Browse files Browse the repository at this point in the history
  • Loading branch information
finiteops committed Feb 19, 2024
1 parent 0e03cac commit d1f5820
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 447 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ on:

env:
EVM_DEPLOYER: ${{ secrets.EVM_DEPLOYER }}
GH_TOKEN: ${{ secrets.GH_PKG_TOKEN }}

jobs:

build-test:
name: "Build and Test"
uses: bitfinity-network/ci-wf/.github/workflows/build-n-test.yml@main
Expand All @@ -57,6 +59,9 @@ jobs:
./scripts/build_solidity.sh
artifact-pre-script: |
export ETHEREUM_GENESIS_ACCOUNTS=${{ inputs.ethereum_genesis_accounts }}
# export GH_TOKEN=
./scripts/evmc-get-release.sh "v0.2.0-2207-g78d7fc4a" "evm-v0.2.0-2207-g78d7fc4a.tar.gz"
./scripts/build.sh
test-script: |
export WASMS_DIR="`pwd`/.artifact"
Expand Down
6 changes: 0 additions & 6 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,6 @@ build_requested_canisters() {
script_dir=$(dirname $0)
project_dir=$(realpath "${script_dir}/..")

cp "$project_dir/src/integration-tests/evm_testnet.did" "$WASM_DIR/evm_testnet.did"
cp "$project_dir/src/integration-tests/evm_testnet.wasm.gz" "$WASM_DIR/evm_testnet.wasm.gz"

cp "$project_dir/src/integration-tests/signature_verification.did" "$WASM_DIR/signature_verification.did"
cp "$project_dir/src/integration-tests/signature_verification.wasm.gz" "$WASM_DIR/signature_verification.wasm.gz"

build_canister "spender_canister" "export-api" "spender.wasm" "spender"
build_canister "minter_canister" "export-api" "minter.wasm" "minter"
build_canister "evm-minter" "export-api" "evm-minter.wasm" "evm-minter"
Expand Down
58 changes: 58 additions & 0 deletions scripts/evmc-get-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/usr/bin/env sh
VERSION="$1"
FILE="$2"

GH_TOKEN="${GH_TOKEN}"
REPO="bitfinity-network/evm-canister"
WASM_DIR=".artifact"

script_dir=$(dirname $0)
assets_dir=$(realpath "${script_dir}/../$WASM_DIR")

if [ -f "$assets_dir/$FILE" ]; then
echo "File aready downloaded $assets_dir/$FILE"
echo "Skip download and unpacking"
exit 0
fi

set -e

mkdir -p "$assets_dir"

assets=$( curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GH_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/$REPO/releases/tags/$VERSION )


# echo "https://api.github.com/repos/$REPO/releases/tags/$VERSION"
# echo "$assets"

echo "Release asses acqured"

for row in $(echo "${assets}" | jq -c '.assets[]'); do
name=$( jq -r '.name' <<< "${row}" )
echo ${name}

if [ "$FILE" = "$name" ]; then
asset_id=$( jq -r '.id' <<< "${row}" )

echo "https://api.github.com/repos/$REPO/releases/assets/$asset_id"

curl -L \
-H "Accept: application/octet-stream" \
-H "Authorization: Bearer $GH_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/$REPO/releases/assets/$asset_id" \
-o "$assets_dir/$FILE"
fi
done

if [ ! -f "$assets_dir/$FILE" ]; then
echo "Release asset not found: $FILE"
exit 33
fi

cd $assets_dir
tar -xzf "$FILE"
Loading

0 comments on commit d1f5820

Please sign in to comment.