Skip to content

Commit

Permalink
chore: upload binaries in CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
liyukun committed Jan 25, 2024
1 parent f4d8f90 commit 3e0f680
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/capsule.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Test with native capsule cases

name: Capsule build/test

on:
pull_request:
paths:
Expand All @@ -8,7 +11,7 @@ on:

jobs:
capsule:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/release.yaml
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

0 comments on commit 3e0f680

Please sign in to comment.