-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: upload binaries in CI workflow
- Loading branch information
liyukun
committed
Jan 25, 2024
1 parent
f4d8f90
commit 3e0f680
Showing
2 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Release contract binaries for mainnet and testnet | ||
|
||
name: Release binaries | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- contracts/** | ||
- lib/** | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Prepare capsule v0.10.2 | ||
run: | | ||
if [ ! -f "/tmp/capsule.tar.gz" ]; then | ||
curl -L https://github.com/nervosnetwork/capsule/releases/download/v0.10.2/capsule_v0.10.2_x86_64-linux.tar.gz -o /tmp/capsule.tar.gz | ||
fi | ||
tar -zxf /tmp/capsule.tar.gz -C /tmp | ||
echo "/tmp/capsule_v0.10.2_x86_64-linux" >> $GITHUB_PATH | ||
- name: Install cross | ||
run: cargo install cross --git https://github.com/cross-rs/cross | ||
|
||
- name: Testnet build | ||
run: capsule build --release | ||
|
||
- name: Upload testnet binaries | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: testnet-contracts | ||
path: build/release | ||
|
||
- name: Capsule clean | ||
run: capsule clean | ||
|
||
- name: Mainnet build | ||
run: capsule build --release -- --features release_export | ||
|
||
- name: Upload mainnet binaries | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: mainnet-contracts | ||
path: build/release | ||
|