-
Notifications
You must be signed in to change notification settings - Fork 6
214 lines (190 loc) · 8.01 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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
name: Build Clients
on:
push:
branches: [master]
paths:
- 'servers/**'
- 'clients/scripts/**'
- 'clients/bitwindow/**'
- 'clients/sidesail/**'
- '.github/workflows/**'
pull_request:
branches: [master]
paths:
- 'servers/**'
- 'clients/scripts/**'
- 'clients/bitwindow/**'
- 'clients/sidesail/**'
- '.github/workflows/**'
jobs:
build:
continue-on-error: true
strategy:
fail-fast: false
matrix:
include:
# Sidesail testchain builds for all os'es
- os: ubuntu-latest
client: sidesail
chain: testchain
- os: macos-latest
client: sidesail
chain: testchain
- os: windows-latest
client: sidesail
chain: testchain
# Sidesail ethereum builds for all os'es
- os: ubuntu-latest
client: sidesail
chain: ethereum
- os: macos-latest
client: sidesail
chain: ethereum
- os: windows-latest
client: sidesail
chain: ethereum
# Sidesail zcash does not build for windows
- os: ubuntu-latest
client: sidesail
chain: zcash
- os: macos-latest
client: sidesail
chain: zcash
# BitWindow builds for all os'es
- os: ubuntu-latest
client: bitwindow
chain: ''
- os: macos-latest
client: bitwindow
chain: ''
- os: windows-latest
client: bitwindow
chain: ''
name: Build ${{ matrix.client }} ${{ matrix.chain }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
working-directory: clients
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
- uses: extractions/setup-just@v1
# Setup go for building bitwindowd
- uses: actions/setup-go@v5
with:
go-version: "1.23"
# Setup go for building bdk-cli
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Create assets/bin directory
run: |
mkdir -p ${{ matrix.client }}/assets/bin
# This workflow uses the latest stable version of the Dart SDK.
- uses: dart-lang/setup-dart@v1
- name: Install dependencies
run: |
cd ${{ matrix.client }}
flutter pub get
# standard macOS sed has subtle differences from gnu
- name: Install GNU sed on macOS
if: runner.os == 'macOS'
run: |
brew install gnu-sed
echo "$(brew --prefix)/opt/gnu-sed/libexec/gnubin" >> $GITHUB_PATH
# https://docs.flutter.dev/get-started/install/linux/desktop
# prettier-ignore
- run: sudo apt-get update -y && sudo apt-get upgrade -y && sudo apt-get install -y curl git unzip xz-utils zip libglu1-mesa && sudo apt-get install clang cmake git ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev
if: runner.os == 'Linux'
- name: Setup macOS app signing
if: runner.os == 'macOS'
run: |
# import certificate into the keychain
echo "${{ secrets.MACOS_CERTIFICATE }}" | base64 --decode > certificate.p12
KEYCHAIN_PASSWORD=$(uuidgen)
echo "Creating keychain"
security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
echo "Setting default keychain"
security default-keychain -s build.keychain
echo "Unlocking keychain"
security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
echo "Setting keychain timeout to 20 minutes"
security set-keychain-settings -t 1200 -l ~/Library/Keychains/build.keychain
echo "Importing certificate into keychain"
security import ./certificate.p12 -k ~/Library/Keychains/build.keychain -P ${{ secrets.MACOS_CERTIFICATE_PASSWORD }} -T /usr/bin/codesign
echo "Setting key partition list"
security set-key-partition-list -S apple-tool:,apple: -s -k "$KEYCHAIN_PASSWORD" ~/Library/Keychains/build.keychain
# Find the Common Name of the certificate we just imported
security find-certificate -a -p build.keychain > certificate.pem
cert_subject=$(openssl x509 -in certificate.pem -noout -subject)
echo Certificate subject: "'$cert_subject'"
cn_part=$(grep -o 'CN = "[^"]*"' <<< "$cert_subject")
cn_value=$(sed 's/CN = "\(.*\)"/\1/' <<< "$cn_part")
echo "Determined code sign identity"
echo "CODESIGN_IDENTITY=$cn_value" >> $GITHUB_ENV
echo "Creating notarization API key file"
echo ${{ secrets.GODOT_MACOS_NOTARIZATION_API_KEY }} | base64 --decode > notarization_api_key.p8
- name: Build app
run: |
chain_param="${{ matrix.chain }}"
if [ -z "$chain_param" ]; then
chain_param="none"
fi
# Everything after the first line is only relevant for macOS
./scripts/build-app.sh ${{ runner.os }} ${{ matrix.client }} "$chain_param" \
"$CODESIGN_IDENTITY" $PWD/notarization_api_key.p8 \
${{ secrets.GODOT_MACOS_NOTARIZATION_API_KEY_ID }} \
${{ secrets.GODOT_MACOS_NOTARIZATION_API_UUID }}
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.client }}-binaries-${{ runner.os }}${{ matrix.chain != '' && format('-{0}', matrix.chain) || '' }}
if-no-files-found: error
path: clients/${{ matrix.client }}/release/*
upload-artifacts-to-releases-drivechain-info:
name: Upload artifacts to releases.drivechain.info
runs-on: ubuntu-latest
needs: build
defaults:
run:
working-directory: clients
# Modified if condition to run even with partial failures
if: |
always() &&
github.event_name == 'push' &&
github.ref == 'refs/heads/master' &&
github.repository_owner == 'LayerTwo-Labs'
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
continue-on-error: true
- name: Rename and move artifacts
working-directory: .
continue-on-error: true
run: |
# Testchain
mv sidesail-binaries-macOS-testchain/testsail-osx64.zip L2-S0-TestSail-latest-x86_64-apple-darwin.zip || true
mv sidesail-binaries-Linux-testchain/testsail-x86_64-linux-gnu.zip L2-S0-TestSail-latest-x86_64-unknown-linux-gnu.zip || true
mv sidesail-binaries-Windows-testchain/testsail-win64.zip L2-S0-TestSail-latest-x86_64-pc-windows-msvc.zip || true
# ZCash
mv sidesail-binaries-macOS-zcash/zsail-osx64.zip L2-S5-ZSail-latest-x86_64-apple-darwin.zip || true
mv sidesail-binaries-Linux-zcash/zsail-x86_64-linux-gnu.zip L2-S5-ZSail-latest-x86_64-unknown-linux-gnu.zip || true
# Ethereum
mv sidesail-binaries-macOS-ethereum/ethsail-osx64.zip L2-S6-EthSail-latest-x86_64-apple-darwin.zip || true
mv sidesail-binaries-Linux-ethereum/ethsail-x86_64-linux-gnu.zip L2-S6-EthSail-latest-x86_64-unknown-linux-gnu.zip || true
mv sidesail-binaries-Windows-ethereum/ethsail-win64.zip L2-S6-EthSail-latest-x86_64-pc-windows-msvc.zip || true
# BitWindow
mv bitwindow-binaries-macOS/bitwindow-osx64.zip BitWindow-latest-x86_64-apple-darwin.zip || true
mv bitwindow-binaries-Linux/bitwindow-x86_64-linux-gnu.zip BitWindow-latest-x86_64-unknown-linux-gnu.zip || true
mv bitwindow-binaries-Windows/bitwindow-win64.zip BitWindow-latest-x86_64-pc-windows-msvc.zip || true
- name: Upload artifacts to releases.drivechain.info
uses: cross-the-world/ssh-scp-ssh-pipelines@latest
continue-on-error: true
with:
host: 45.33.96.47
user: root
pass: ${{ secrets.RELEASES_SERVER_PW }}
port: 22
scp: |
'L2-S*.zip' => '/var/www/html/'
'BitWindow-*.zip' => '/var/www/html/'