-
Notifications
You must be signed in to change notification settings - Fork 38
94 lines (85 loc) · 3.07 KB
/
prepare-builtin-binaries.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
name: Prepare gw-builtin-binaries
on:
push:
branches:
- develop
paths:
- 'crates/builtin-binaries/build.rs'
jobs:
publish:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Install Rust components
run: rustup component add rustfmt && rustup component add clippy
- name: Install moleculec
run: |
test "$(moleculec --version)" = "Moleculec 0.7.2" \
|| cargo install moleculec --version 0.7.2 --force
- name: Install capsule
env:
CAPSULE_VERSION: v0.7.0
run: |
(which capsule && test "$(capsule --version)" = "Capsule 0.7.0") \
|| curl -OL https://github.com/nervosnetwork/capsule/releases/download/${CAPSULE_VERSION}/capsule_${CAPSULE_VERSION}_x86_64-linux.tar.gz \
&& tar xf capsule_${CAPSULE_VERSION}_x86_64-linux.tar.gz \
&& mv capsule_${CAPSULE_VERSION}_x86_64-linux/capsule ~/.cargo/bin/ \
&& rm capsule_${CAPSULE_VERSION}_x86_64-linux.tar.gz \
&& rm -rf capsule_${CAPSULE_VERSION}_x86_64-linux/
capsule --version
# - name: Cache of component.gwos
# id: gwos-cache
# uses: actions/cache@v3
# with:
# path: |
# gwos/build/release/*
# gwos/c/build/*-generator
# gwos/c/build/*-validator
# gwos/c/build/account_locks/*
# key: component.gwos-${{ hashFiles('gwos/**') }}
# - name: Build gwos binaries
# if: steps.gwos-cache.outputs.cache-hit != 'true'
# working-directory: gwos
# run: cd c && make && cd .. && capsule build --release --debug-output
- name: Cache of component.gwos-evm
id: godwoken-polyjuice-cache
uses: actions/cache@v3
with:
path: |
gwos-evm/build/*generator*
gwos-evm/build/*validator*
key: component.gwos-evm-${{ hashFiles('gwos-evm/**') }}
- name: Build godwoken-polyjuice
if: steps.godwoken-polyjuice-cache.outputs.cache-hit != 'true'
working-directory: gwos-evm
run: |
git submodule update --init --recursive --depth=1
make all-via-docker
- name: Copy contracts from prebuild docker images
run: devtools/fetch-binaries.sh
- name: Run build script of gw-builtin-binaries
run: |
cargo build -p gw-builtin-binaries
- name: Checksum
working-directory: crates/builtin-binaries/builtin
run: bash -c 'sha256sum `find . -not -path checksum.txt -type f | sort` > checksum.txt'
# commit to submodule repo
- name: Push to godwoken-builtin-binaries repo
uses: stefanzweifel/git-auto-commit-action@v5
with:
repository: crates/builtin-binaries/builtin
branch: master
commit_message: Commit from CI ${{ github.sha }}