forked from yihuang/gravity-bridge
-
Notifications
You must be signed in to change notification settings - Fork 18
94 lines (90 loc) · 3.06 KB
/
automated-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
permissions:
contents: write
name: Automated Release
env:
CARGO_TERM_COLOR: always
jobs:
release:
name: build-release-assets
runs-on: ubuntu-latest
steps:
# Setup Golang Environemnt
- name: setup-go
uses: actions/setup-go@v3
with:
go-version: 1.19
# Setup Rust Environment
- name: setup-rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
# Setup Node Environment
- name: setup-node
uses: actions/setup-node@v2
with:
node-version: '16'
# Checkout repository code
- name: checkout-code
uses: actions/checkout@v3
with:
toolchain: 1.58
# Golang Cache
- name: go-cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('module/go.sum') }}
# Rust Cache
- name: rust-cache
uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
orchestrator/target/
key: ${{ runner.os }}-cargo-${{ hashFiles('orchestrator/Cargo.lock') }}
# Node Cache
- name: node-cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('solidity/package-lock.json') }}
# Build Go Artifacts
- name: build-go
run: cd module && make build
# Build Node and Solidity Artifacts
- name: build-node-solidity
run: cd solidity && npm ci && npm run typechain && npm run compile-deployer
# Build Rust Artifacts
- name: build-rust
run: cd orchestrator && cargo install cross && cross build --target x86_64-unknown-linux-musl --features ethermint --release --all
# Create Release and Upload artifacts
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
orchestrator/target/x86_64-unknown-linux-musl/release/gorc
orchestrator/target/x86_64-unknown-linux-musl/release/register-delegate-keys
orchestrator/target/x86_64-unknown-linux-musl/release/relayer
orchestrator/target/x86_64-unknown-linux-musl/release/test_runner
module/build/gravity
solidity/artifacts/contracts/Gravity.sol/Gravity.json
solidity/artifacts/contracts/EthGravityWrapper.sol/EthGravityWrapper.json
solidity/artifacts/contracts/TestERC20A.sol/TestERC20A.json
solidity/artifacts/contracts/TestERC20B.sol/TestERC20B.json
solidity/artifacts/contracts/TestERC20C.sol/TestERC20C.json
solidity/contract-deployer
LICENSE
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}