-
Notifications
You must be signed in to change notification settings - Fork 6
180 lines (141 loc) · 5.82 KB
/
build.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
name: Build
on:
pull_request:
push:
branches:
- "master"
- "sidechain"
workflow_dispatch:
jobs:
build-linux:
name: Build Linux binaries
runs-on: ubuntu-latest-large
steps:
# https://zcash.readthedocs.io/en/master/rtd_pages/Debian-Ubuntu-build.html
- name: install Linux deps
run: sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python3 python3-zmq zlib1g-dev curl bsdmainutils automake libtinfo5
- uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ./depends
key: ${{ runner.os }}-${{ hashFiles('depends/packages/**') }}
- name: download dependencies
run: make -C ./depends download-linux
- name: build dependencies
run: make -C ./depends -j
- run: ./autogen.sh
- run: echo "HOST=$(./depends/config.guess)" >> $GITHUB_ENV
- run: echo "CONFIG_SITE=$PWD/depends/$HOST/share/config.site" >> $GITHUB_ENV
- run: ./configure --disable-tests --disable-bench --disable-hardening --enable-online-rust
- run: make -C src cargo-build-lib
- run: echo BRIDGE_LOCATION=$(dirname $(./contrib/devtools/find-libcxxbridge.sh)) >> $GITHUB_ENV
- run: echo LDFLAGS="-L$BRIDGE_LOCATION -lcxxbridge1" >> $GITHUB_ENV
# Reconfigure the build, taking our freshly compiled Rust C++ bridge into account.
- run: ./configure --disable-tests --disable-bench --disable-hardening --enable-online-rust
- run: make -j
- uses: actions/upload-artifact@v4
with:
name: binaries-${{ runner.os }}
if-no-files-found: error
path: |
src/zsided
src/zside-cli
build-windows:
name: Build Windows binaries
runs-on: ubuntu-latest
steps:
# https://zcash.readthedocs.io/en/master/rtd_pages/Debian-Ubuntu-build.html
- uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ./depends
key: Windows-${{ hashFiles('depends/packages/**') }}
- name: Run build in Docker
uses: addnab/docker-run-action@v3
with:
image: electriccoinco/zcashd-build-ubuntu-jammy
options: -v ${{ github.workspace }}:/zside --workdir=/zside
shell: bash
run: |
set -e
make -C ./depends download-win
HOST=x86_64-w64-mingw32 make -C ./depends
export CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site
./autogen.sh
./configure --disable-tests --disable-bench --disable-hardening --enable-online-rust
make -C src cargo-build-lib
BRIDGE_LOCATION=$(dirname $(./contrib/devtools/find-libcxxbridge.sh))
export LDFLAGS="-L$BRIDGE_LOCATION -lcxxbridge1"
./configure --disable-tests --disable-bench --disable-hardening --enable-online-rust
make -j
- uses: actions/upload-artifact@v4
with:
name: binaries-Windows
if-no-files-found: error
path: |
src/zsided.exe
src/zside-cli.exe
build-macos:
name: Build macOS binaries
runs-on: macos-latest-large
steps:
# https://zcash.readthedocs.io/en/master/rtd_pages/Debian-Ubuntu-build.html
- name: install deps
run: brew install pkgconfig automake autoconf libtool coreutils
- uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ./depends
key: ${{ runner.os }}-${{ hashFiles('depends/packages/**') }}
- name: Set HOST + BUILD
run: |
echo BUILD=x86_64-apple-darwin23.0.0 >> $GITHUB_ENV
echo HOST=x86_64-apple-darwin23.0.0 >> $GITHUB_ENV
- name: download dependencies
run: make -C ./depends download-osx
- name: build dependencies
run: make -C ./depends -j
- run: ./autogen.sh
- run: echo "CONFIG_SITE=$PWD/depends/$HOST/share/config.site" >> $GITHUB_ENV
- run: ./configure --disable-tests --disable-bench --disable-hardening --enable-online-rust
- run: make -C src cargo-build-lib
- run: find ./target -name libcxxbridge1.a
- run: echo BRIDGE_LOCATION=$(dirname $(./contrib/devtools/find-libcxxbridge.sh)) >> $GITHUB_ENV
- run: echo LDFLAGS="-L$BRIDGE_LOCATION -lcxxbridge1" >> $GITHUB_ENV
# Reconfigure the build, taking our freshly compiled Rust C++ bridge into account.
- run: ./configure --disable-tests --disable-bench --disable-hardening --enable-online-rust
- run: make -j
- uses: actions/upload-artifact@v4
with:
name: binaries-${{ runner.os }}
if-no-files-found: error
path: |
src/zsided
src/zside-cli
upload-artifacts-to-releases-drivechain-info:
name: Upload artifacts to releases.drivechain.info
runs-on: ubuntu-latest
needs: [build-linux, build-macos]
# avoid uploading on PRs!
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository_owner == 'LayerTwo-Labs'
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Zip artifacts
run: |
mv binaries-Linux zside-latest-linux
zip -r zside-latest-linux.zip zside-latest-linux
mv binaries-macOS zside-latest-macos
zip -r zside-latest-macOS.zip zside-latest-macos
- name: Upload artifacts to releases.drivechain.info
uses: cross-the-world/ssh-scp-ssh-pipelines@latest
with:
host: 45.33.96.47
user: root
pass: ${{ secrets.RELEASES_SERVER_PW }}
port: 22
scp: |
'zside-latest-*.zip' => '/var/www/html/'