-
Notifications
You must be signed in to change notification settings - Fork 9
149 lines (126 loc) · 5.6 KB
/
pr-main.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
name: Build and Upload Electron App on Windows, macOS, and Linux
on:
push:
branches:
- main
jobs:
build-and-upload-windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install Emscripten
run: |
curl -L https://github.com/emscripten-core/emsdk/archive/refs/tags/3.1.61.zip -o emsdk.zip
tar -xf emsdk.zip
cd emsdk-3.1.61
./emsdk install latest
./emsdk activate latest
- name: Compile wasm
shell: bash
run: |
cd emsdk-3.1.61
source ./emsdk_env.sh
cd ..
emcc -O3 -sFETCH -s FORCE_FILESYSTEM=1 -lwebsocket.js -sEXPORTED_FUNCTIONS=_qwallet,_main -sEXPORTED_RUNTIME_METHODS=ccall -pthread -sPROXY_TO_PTHREAD -s PTHREAD_POOL_SIZE=8 -s INITIAL_MEMORY=33554432 -s WASM_ASYNC_COMPILATION=0 -s SINGLE_FILE=1 -s -D_LARGEFILE64_SOURCE=1 -fPIC -Wno-implicit-function-declaration -msse2 -msse3 -msse4.1 -msimd128 -msse4.2 -mavx -sASYNCIFY wasm.c -lnodefs.js -lidbfs.js -o app/server/utils/a.out.js -s MODULARIZE=1 -s 'EXPORT_NAME="createModule"'
- name: Install Dependencies and build client
run: |
mkdir app/server/dist
cd app/client
npm install
npm run build
- name: Install Dependencies and build electron app for Windows
run: |
cd app/server
npm install
npx electron-packager . --overwrite --platform=win32 --arch=x64 --icon=logo.ico --prune=true --out=release-builds -f --asar
mkdir ./release-builds/qwallet-win32-x64/keys
touch ./release-builds/qwallet-win32-x64/keys/.keep
- name: Zip the Windows build
run: |
Compress-Archive -Path app/server/release-builds/qwallet-win32-x64/* -DestinationPath Qwallet-Windows.zip
- name: Upload Windows build to Server
env:
TOKEN: ${{ secrets.TOKEN }}
UPLOAD_URL: ${{ secrets.UPLOAD_URL }}
run: curl -F "file=@Qwallet-Windows.zip" ${env:UPLOAD_URL}?token=${env:TOKEN}
build-and-upload-osx:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Set up Emscripten & Compile wasm
run: |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install 3.1.54
./emsdk activate 3.1.54
source ./emsdk_env.sh
cd ..
emcc -O3 -sFETCH -s FORCE_FILESYSTEM=1 -lwebsocket.js -sEXPORTED_FUNCTIONS=_qwallet,_main -sEXPORTED_RUNTIME_METHODS=ccall -pthread -sPROXY_TO_PTHREAD -s PTHREAD_POOL_SIZE=8 -s INITIAL_MEMORY=33554432 -s WASM_ASYNC_COMPILATION=0 -s SINGLE_FILE=1 -s -D_LARGEFILE64_SOURCE=1 -fPIC -Wno-implicit-function-declaration -msse2 -msse3 -msse4.1 -msimd128 -msse4.2 -mavx -sASYNCIFY wasm.c -lnodefs.js -lidbfs.js -o app/server/utils/a.out.js -s MODULARIZE=1 -s 'EXPORT_NAME="createModule"' -v
- name: Install Dependencies and build client
run: |
mkdir app/server/dist
cd app/client
npm install
npm run build
- name: Install Dependencies and build electron app for macOS
run: |
cd app/server
npm install
npx electron-packager . --overwrite --platform=darwin --arch=x64 --icon=logo.ico --prune=true --out=release-builds -f --asar
- name: Zip the macOS build
run: |
mkdir Qwallet-macOS
cp -rf app/server/release-builds/qwallet-darwin-x64/* ./Qwallet-macOS/
zip -r Qwallet-macOS.zip Qwallet-macOS/*
- name: Upload macOS build to Server
env:
TOKEN: ${{ secrets.TOKEN }}
UPLOAD_URL: ${{ secrets.UPLOAD_URL }}
run: curl -F "file=@Qwallet-macOS.zip" $UPLOAD_URL?token=$TOKEN
build-and-upload-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Set up Emscripten & Compile wasm
run: |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install 3.1.54
./emsdk activate 3.1.54
source ./emsdk_env.sh
cd ..
emcc -O3 -sFETCH -s FORCE_FILESYSTEM=1 -lwebsocket.js -sEXPORTED_FUNCTIONS=_qwallet,_main -sEXPORTED_RUNTIME_METHODS=ccall -pthread -sPROXY_TO_PTHREAD -s PTHREAD_POOL_SIZE=8 -s INITIAL_MEMORY=33554432 -s WASM_ASYNC_COMPILATION=0 -s SINGLE_FILE=1 -s -D_LARGEFILE64_SOURCE=1 -fPIC -Wno-implicit-function-declaration -msse2 -msse3 -msse4.1 -msimd128 -msse4.2 -mavx -sASYNCIFY wasm.c -lnodefs.js -lidbfs.js -o app/server/utils/a.out.js -s MODULARIZE=1 -s 'EXPORT_NAME="createModule"' -v
- name: Install Dependencies and build client
run: |
mkdir -p app/server/dist
cd app/client
npm install
npm run build
- name: Install Dependencies and build electron app for Linux
run: |
cd app/server
npm install
npx electron-packager . --overwrite --platform=linux --arch=x64 --icon=logo.ico --prune=true --out=release-builds -f --asar
mkdir ./release-builds/qwallet-linux-x64/keys
- name: Zip the Linux build
run: tar -czvf Qwallet-Linux.tar.gz -C app/server/release-builds/qwallet-linux-x64/ .
- name: Upload Linux build to Server
env:
TOKEN: ${{ secrets.TOKEN }}
UPLOAD_URL: ${{ secrets.UPLOAD_URL }}
run: curl -F "file=@Qwallet-Linux.tar.gz" $UPLOAD_URL?token=$TOKEN