-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (49 loc) · 1.98 KB
/
artifacts-release.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
54
55
56
57
58
on:
push:
tags:
- "v*.*.*"
name: "Contract Artifacts (release)"
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: "Build airdrop contracts"
run: |
./scripts/compile_airdrop_with_docker.sh
- name: "Set up deploy key for artifacts repo"
uses: "webfactory/[email protected]"
with:
ssh-private-key: "${{ secrets.ARTIFACTS_RELEASE_KEY }}"
- name: Push artifacts
run: |
COMMIT_HASH="$(git log -1 --format="%H")"
git clone --depth=1 "[email protected]:zkLend/zklend-contract-artifacts" ./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
cp ./build/Airdrop.json ./artifacts/zend-token/$COMMIT_HASH/Airdrop.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