Skip to content

Commit

Permalink
update dependencies for release pipeline (#29)
Browse files Browse the repository at this point in the history
Ensure all dependencies needed for building the contract
Use cache from main test pipeline
  • Loading branch information
petersalomonsen authored Dec 27, 2024
1 parent 8865165 commit 5c554e7
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 23 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -412,3 +412,5 @@ jobs:
run: |
yarn install
yarn test-web
2 changes: 1 addition & 1 deletion .github/workflows/release-ai-proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: "Build and publish AI proxy"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install dependencies
run: |
curl -fsSL https://developer.fermyon.com/downloads/install.sh | bash
Expand Down
49 changes: 27 additions & 22 deletions .github/workflows/release-example-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,51 +4,56 @@ on:
push:
tags:
- 'v*.*.*'

pull_request:
branches: [ main ]

jobs:
buildexamplecontracts:
name: Build example contracts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Restore Cache
uses: actions/cache@v4
with:
path: |
~/.wasmtime
~/.cargo
bin
node_modules
emsdk
wabt-1.0.35
binaryen-version_116
quickjs-2024-01-13
key: ${{ runner.os }}-dependencies-${{ hashFiles('**/yarn.lock', '.devcontainer/install-dependencies.sh') }}

- name: Install Wasmtime and Rust dependencies
- name: Set up paths and Rust
run: |
curl https://wasmtime.dev/install.sh -sSf | bash
export PATH="$HOME/.wasmtime/bin:$PATH"
echo "$HOME/.wasmtime/bin" >> $GITHUB_PATH
echo "$(pwd)/binaryen-version_116/bin" >> $GITHUB_PATH
echo "$(pwd)/wabt-1.0.35/bin" >> $GITHUB_PATH
rustup target add wasm32-wasip1
rustup target add wasm32-unknown-unknown
cargo install cargo-wasi
wget https://github.com/WebAssembly/binaryen/releases/download/version_116/binaryen-version_116-x86_64-linux.tar.gz
tar -xvzf binaryen-version_116-x86_64-linux.tar.gz
sudo cp -r binaryen-version_116/* /usr/
rm -Rf binaryen-version_116*
wget https://github.com/WebAssembly/wabt/releases/download/1.0.35/wabt-1.0.35.tar.xz
tar -xvf wabt-1.0.35.tar.xz
cd wabt-1.0.35
mkdir build
cd build
cmake ..
sudo cmake --build . --target install
- name: Build example contracts
run: |
(cd examples/nft && ./build.sh)
(cd examples/minimumweb4 && ./build.sh)
(cd examples/fungibletoken && ./build.sh)
- name: Package WASM files into a ZIP
run: |
mkdir -p release
zip -j release/example_contracts.zip examples/nft/out/nft.wasm examples/minimumweb4/out/minimum_web4.wasm examples/fungibletoken/out/fungible_token.wasm
- name: Upload WASM ZIP artifact
uses: actions/upload-artifact@v3
if: startsWith(github.ref, 'refs/tags/')
with:
name: wasm-zip
path: release/example_contracts.zip

release:
name: Create Release
needs: buildexamplecontracts
Expand Down Expand Up @@ -79,4 +84,4 @@ jobs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./example_contracts.zip
asset_name: example_contracts.zip
asset_content_type: application/zip
asset_content_type: application/zip

0 comments on commit 5c554e7

Please sign in to comment.