-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (45 loc) · 1.8 KB
/
artifacts-dev.yaml
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
on:
push:
branches:
- "master"
name: "Contract Artifacts (dev)"
jobs:
build:
name: "Push contract artifacts"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout source code"
uses: "actions/checkout@v3"
with:
submodules: "recursive"
- name: "Install foundry nightly"
uses: "foundry-rs/foundry-toolchain@v1"
with:
version: "nightly"
- name: "Build L1 contracts"
run: |
forge build
- name: "Build L2 contracts"
run: |
./scripts/compile_l2_with_docker.sh
- name: "Set up deploy key for artifacts repo"
uses: "webfactory/ssh-agent@v0.7.0"
with:
ssh-private-key: "${{ secrets.ARTIFACTS_DEV_KEY }}"
- name: Push artifacts
run: |
COMMIT_HASH="$(git log -1 --format="%H")"
git clone --depth=1 "git@github.com:zkLend/zklend-contract-artifacts-dev" ./artifacts
mkdir -p ./artifacts/zend-token/$COMMIT_HASH
cp ./out/ZendToken.sol/ZendToken.json ./artifacts/zend-token/$COMMIT_HASH/
cp ./out/TokenEscrow.sol/TokenEscrow.json ./artifacts/zend-token/$COMMIT_HASH/
cp ./out/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.json ./artifacts/zend-token/$COMMIT_HASH/
cp ./out/ProxyAdmin.sol/ProxyAdmin.json ./artifacts/zend-token/$COMMIT_HASH/
cp ./build/ERC20.json ./artifacts/zend-token/$COMMIT_HASH/StarknetERC20.json
(cd ./artifacts/zend-token/ && rm -rf ./latest && ln -s ./$COMMIT_HASH ./latest)
cd ./artifacts
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git add .
git commit -m "artifacts: add contract artifacts from CI"
git push