Skip to content

Commit

Permalink
Merge pull request #366 from icon-project/365-fix-stellar-build-issue
Browse files Browse the repository at this point in the history
ci: fix stellar build issue
  • Loading branch information
gcranju authored Sep 17, 2024
2 parents 44f947a + 84ae144 commit 72490e8
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 6 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,37 @@ jobs:
with:
name: solidity-contracts
path: solidity-contracts.zip

build_stellar:
name: Build stellar Contracts
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
with:
submodules: true
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.79.0
target: wasm32-unknown-unknown
override: true
profile: minimal

- name: Install wasm32
run: |
rustup target add wasm32-unknown-unknown
cargo install --locked soroban-cli
- name: Compile WASM
run: |
bash ./scripts/optimize-stellar.sh
cd artifacts/stellar && zip -r ../../stellar-contracts.zip . -j
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: stellar-contracts
path: stellar-contracts.zip

release:
name: Release and Publish
runs-on: ubuntu-latest
Expand Down Expand Up @@ -107,6 +138,12 @@ jobs:
name: solidity-contracts
path: solidity-contracts

- name: Download Stellar Artifacts
uses: actions/download-artifact@v4
with:
name: stellar-contracts
path: stellar-contracts

- name: Unzip Javascore Artifacts
run: unzip javascore-contracts/javascore-contracts.zip -d javascore-contracts && rm -rf javascore-contracts/javascore-contracts.zip

Expand All @@ -115,6 +152,9 @@ jobs:

- name: Unzip Cosmwasm Artifacts
run: unzip solidity-contracts/solidity-contracts.zip -d solidity-contracts && rm -rf solidity-contracts/solidity-contracts.zip

- name: Unzip Stellar Artifacts
run: unzip stellar-contracts/stellar-contracts.zip -d stellar-contracts && rm -rf stellar-contracts/stellar-contracts.zip

- name: Changelog
uses: scottbrenner/generate-changelog-action@master
Expand Down Expand Up @@ -143,4 +183,5 @@ jobs:
./javascore-contracts/*.jar
./cosmwasm-contracts/*.wasm
./solidity-contracts/*
./stellar-contracts/*
check256sums.txt
2 changes: 1 addition & 1 deletion .github/workflows/stellar-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.78.0
toolchain: 1.79.0
target: wasm32-unknown-unknown
override: true
profile: minimal
Expand Down
9 changes: 4 additions & 5 deletions scripts/install_sui.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#!/bin/bash
## Install sui binary from latest mainnet release
echo $PWD
repo_url="https://api.github.com/repos/MystenLabs/sui/releases/latest"
latest_tag=$(curl -sSL "$repo_url" | jq -r '.tag_name')
repo_url="https://api.github.com/repos/MystenLabs/sui/releases"
latest_tag=$(curl -sSL "$repo_url" | jq -r '.[] | select(.tag_name | contains("mainnet")) | .tag_name' | head -n 1)
ubuntu_artifact="sui-mainnet-${latest_tag#mainnet-}-ubuntu-x86_64.tgz"
browser_download_url=$(curl -sSL "$repo_url" | jq -r --arg ua "$ubuntu_artifact" '.assets[] | select(.name == $ua) | .browser_download_url')
browser_download_url=$(curl -sSL "$repo_url" | jq -r --arg ua "$ubuntu_artifact" '.[] | select(.tag_name == "'$latest_tag'") | .assets[] | select(.name == $ua) | .browser_download_url')
wget -qO "$ubuntu_artifact" "$browser_download_url"

sudo tar -xzvf "$ubuntu_artifact" -C /usr/local/bin
rm "$ubuntu_artifact"
which sui
which sui

0 comments on commit 72490e8

Please sign in to comment.