-
Notifications
You must be signed in to change notification settings - Fork 7
39 lines (34 loc) · 1.22 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
on:
create:
name: Contract Artifacts (release)
jobs:
build:
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
name: Push contract artifacts
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2
with:
submodules: true
- name: Generate artifacts
run: |
./scripts/compile_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/v1-core
cp -r ./build ./artifacts/v1-core/$COMMIT_HASH
rm -rf ./artifacts/v1-core/latest
(cd ./artifacts/v1-core/ && 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