-
Notifications
You must be signed in to change notification settings - Fork 1
310 lines (298 loc) · 11.4 KB
/
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
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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
name: Release
on:
release:
types: [published]
env:
SSC_REPO: 'playmint/socket'
SSC_BRANCH: 'playmint-next'
APP_NAME: 'playerchaindemo'
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: 'pages'
cancel-in-progress: true
jobs:
macos:
name: macos
runs-on: macOS-14
timeout-minutes: 30
steps:
- name: configure certs
env:
CERTIFICATE_BASE64: ${{ secrets.SUBSTREAM_APPLE_SIGNING_CERT }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
P12_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate and provisioning profile from secrets
if [[ -z "$CERTIFICATE_BASE64" ]]; then
echo "No certificate provided"
exit 1
fi
echo -n "$CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
# create temporary keychain
if [[ -z "$KEYCHAIN_PASSWORD" ]]; then
echo "No keychain password provided"
exit 1
fi
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security default-keychain -s $KEYCHAIN_PATH
security find-identity -v -p codesigning
- name: checkout socket
uses: actions/checkout@v3
with:
repository: ${{ env.SSC_REPO }}
ref: '${{ env.SSC_BRANCH }}'
path: 'socket'
- name: install node
uses: actions/[email protected]
with:
node-version: 20.x
- name: cache socket build
id: cache-ssc
uses: actions/cache@v3
env:
cache-name: cache-ssc
with:
path: './socket/build'
key: ${{ runner.os }}-ssc-${{ hashFiles('socket/.git/refs/heads/*') }}
restore-keys: |
${{ runner.os }}-ssc-${{ env.cache-name }}-
${{ runner.os }}-ssc-
${{ runner.os }}-
- name: install deps
run: |
brew install automake pnpm libtool
- name: build ssc
working-directory: './socket'
run: |
./bin/install.sh
env:
VERBOSE: '1'
NO_ANDROID: '1'
NO_IOS: '1'
CI: 'true'
SSC_ANDROID_CI: 'false'
- name: checkout app
uses: actions/checkout@v3
with:
ref: '${{ github.event.release.target_commitish }}'
path: './app'
- name: build app
working-directory: './app'
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
SS_VERSION: '${{ github.ref_name }}'
run: |
ssc --version
pnpm install
pnpm run release:macos
ls build/**/*
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: '${{ github.event.release.upload_url }}'
asset_path: './app/build/mac/${{ env.APP_NAME }}.zip'
asset_name: '${{ env.APP_NAME }}-macos-arm64.zip'
asset_content_type: 'application/zip'
linux:
name: linux
timeout-minutes: 30
runs-on: ubuntu-22.04
steps:
- name: checkout socket
uses: actions/checkout@v3
with:
repository: ${{ env.SSC_REPO }}
ref: '${{ env.SSC_BRANCH }}'
path: 'socket'
- name: install node
uses: actions/[email protected]
with:
node-version: 20.x
- name: install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: install deps
run: |
sudo apt-get update
sudo apt install software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt install -y gcc-12 g++-12 libpthread-stubs0-dev libwebkit2gtk-4.1-dev at-spi2-core
sudo apt install -y \
git \
build-essential \
clang-14 \
libc++abi-14-dev \
libwebkit2gtk-4.1-dev \
autoconf \
pkg-config \
libtool \
libwebkit2gtk-4.1-dev \
curl
- name: cache socket build
id: cache-ssc
uses: actions/cache@v3
env:
cache-name: cache-ssc
with:
path: './socket/build'
key: ${{ runner.os }}-ssc-${{ hashFiles('socket/.git/refs/heads/*') }}
restore-keys: |
${{ runner.os }}-ssc-${{ env.cache-name }}-
${{ runner.os }}-ssc-
${{ runner.os }}-
- name: build ssc
working-directory: 'socket'
run: |
./bin/install.sh
env:
VERBOSE: '1'
NO_ANDROID: '1'
NO_IOS: '1'
CI: 'true'
SSC_ANDROID_CI: 'false'
- name: checkout app
uses: actions/checkout@v3
with:
ref: '${{ github.event.release.target_commitish }}'
path: './app'
- name: build app
working-directory: './app'
env:
SS_VERSION: '${{ github.ref_name }}'
run: |
ssc --version
pnpm install
pnpm release:linux
ls build/**/*
mv build/linux/*.deb build/linux/${{ env.APP_NAME }}-linux-x64.deb
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: '${{ github.event.release.upload_url }}'
asset_path: './app/build/linux/${{ env.APP_NAME }}-linux-x64.deb'
asset_name: '${{ env.APP_NAME }}-linux-x64.deb'
asset_content_type: 'application/vnd.debian.binary-package'
windows:
name: windows
runs-on: windows-2022
timeout-minutes: 30
steps:
- name: checkout socket
uses: actions/checkout@v3
with:
repository: ${{ env.SSC_REPO }}
ref: '${{ env.SSC_BRANCH }}'
path: 'socket'
- name: install node
uses: actions/[email protected]
with:
node-version: 20.x
- name: install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
##############################
# disabled as ssc build fails ... wait til 0.6 released
###################################
# - name: cache socket build
# id: cache-ssc
# uses: actions/cache@v3
# env:
# cache-name: cache-ssc
# with:
# path: './socket/build'
# key: ${{ runner.os }}-ssc-${{ hashFiles('socket/.git/refs/heads/*') }}
# restore-keys: |
# ${{ runner.os }}-ssc-${{ env.cache-name }}-
# ${{ runner.os }}-ssc-
# ${{ runner.os }}-
# - name: build ssc
# working-directory: './socket'
# shell: pwsh
# run: |
# ./bin/install.ps1 -verbose -yesdeps
# env:
# NO_ANDROID: '1'
# SSC_ANDROID_CI: 'false'
# CI: 'true'
# WindowsSDKVersion: '10.0.22621.0'
# - name: ssc env
# working-directory: './socket'
# shell: pwsh
# run: |
# echo "::add-path::$env:LOCALAPPDATA\Programs\socketsupply\bin"
# echo "$env:LOCALAPPDATA\Programs\socketsupply\bin" >> $env:GITHUB_PATH
# env:
# ACTIONS_ALLOW_UNSECURE_COMMANDS: true
# - name: build app
# working-directory: './app'
# env:
# SS_VERSION: '${{ github.ref_name }}'
# run: |
# ssc --version
# pnpm install
# pnpm run build
# ls build/**/*
# - name: Upload Release Asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: '${{ github.event.release.upload_url }}'
# asset_path: './app/build/win/${{ env.APP_NAME }}.appx'
# asset_name: '${{ env.APP_NAME }}-win-x64.appx'
# asset_content_type: 'application/appx'
pwa:
name: pwa
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
timeout-minutes: 30
runs-on: ubuntu-22.04
steps:
- name: install node
uses: actions/[email protected]
with:
node-version: 20.x
- name: install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: checkout app
uses: actions/checkout@v3
with:
ref: '${{ github.event.release.target_commitish }}'
path: './app'
- name: build app
working-directory: './app'
env:
SS_VERSION: '${{ github.ref_name }}'
run: |
pnpm install
pnpm release:pwa
- name: setup pages
uses: actions/configure-pages@v4
- name: upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './dist'
- name: deploy pages
id: deployment
uses: actions/deploy-pages@v4