Skip to content

Commit bfbbcb2

Browse files
committed
Feature: webgl cross build support
1 parent 401d41f commit bfbbcb2

12 files changed

Lines changed: 497 additions & 365 deletions

File tree

.github/workflows/ci.yml

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -47,26 +47,13 @@ jobs:
4747
restore-keys: |
4848
${{ runner.os }}-emscripten-
4949
50-
- name: Cache OpenSSL
51-
uses: actions/cache@v3
52-
with:
53-
path: openssl-wasm
54-
key: ${{ runner.os }}-openssl-3.3.2-wasm
55-
restore-keys: |
56-
${{ runner.os }}-openssl-
57-
58-
- name: Build OpenSSL
50+
- name: Build WASM: OpenSSL + SQLCipher
5951
run: |
60-
if [ ! -d "openssl-wasm/lib" ]; then
61-
echo "Building OpenSSL for WASM..."
62-
nix develop --command bash -c "./build-openssl.sh"
63-
else
64-
echo "Using cached OpenSSL"
65-
fi
66-
67-
- name: Build WASM
52+
nix develop --command bash -c "./build-openssl.sh && ./build-wasm.sh"
53+
54+
- name: Build WebGL: OpenSSL + SQLCipher
6855
run: |
69-
nix develop --command bash -c "./build.sh"
56+
nix develop .#webgl --command bash -c "./build-openssl.sh && ./build-webgl.sh"
7057
7158
- name: Prepare cross-platform test
7259
run: |
@@ -86,14 +73,21 @@ jobs:
8673
test -f dist/sqlcipher.cjs
8774
test -f dist/sqlcipher.mjs
8875
test -f dist/sqlcipher.wasm
76+
test -f target/results/sqlcipher-wasm.zip
77+
test -f target/results/sqlcipher-webgl.zip
8978
90-
- name: Upload build artifacts
79+
- name: Upload WASM archive
9180
uses: actions/upload-artifact@v4
9281
with:
93-
name: wasm-build
94-
path: |
95-
dist/
96-
lib/
82+
name: sqlcipher-wasm
83+
path: target/results/sqlcipher-wasm.zip
84+
retention-days: 30
85+
86+
- name: Upload WebGL archive
87+
uses: actions/upload-artifact@v4
88+
with:
89+
name: sqlcipher-webgl
90+
path: target/results/sqlcipher-webgl.zip
9791
retention-days: 30
9892

9993
- name: Upload test results
@@ -121,7 +115,6 @@ jobs:
121115
uses: softprops/action-gh-release@v1
122116
with:
123117
files: |
124-
dist/sqlcipher.cjs
125-
dist/sqlcipher.mjs
126-
dist/sqlcipher.wasm
118+
target/results/sqlcipher-wasm.zip
119+
target/results/sqlcipher-webgl.zip
127120
generate_release_notes: true

.github/workflows/pr-check.yml

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -48,26 +48,9 @@ jobs:
4848
restore-keys: |
4949
${{ runner.os }}-emscripten-
5050
51-
- name: Cache OpenSSL
52-
uses: actions/cache@v3
53-
with:
54-
path: openssl-wasm
55-
key: ${{ runner.os }}-openssl-3.3.2-wasm
56-
restore-keys: |
57-
${{ runner.os }}-openssl-
58-
59-
- name: Build OpenSSL
60-
run: |
61-
if [ ! -d "openssl-wasm/lib" ]; then
62-
echo "Building OpenSSL for WASM..."
63-
nix develop --command bash -c "./build-openssl.sh"
64-
else
65-
echo "Using cached OpenSSL"
66-
fi
67-
6851
- name: Quick build test
6952
run: |
70-
nix develop --command bash -c "./build.sh"
53+
nix develop --command bash -c "./build-openssl.sh && ./build-wasm.sh"
7154
ls -lh dist/
7255
7356
quick-test:
@@ -97,14 +80,14 @@ jobs:
9780
- name: Cache OpenSSL
9881
uses: actions/cache@v3
9982
with:
100-
path: openssl-wasm
83+
path: target/results/openssl
10184
key: ${{ runner.os }}-openssl-3.3.2-wasm
10285
restore-keys: |
10386
${{ runner.os }}-openssl-
10487
10588
- name: Build OpenSSL
10689
run: |
107-
if [ ! -d "openssl-wasm/lib" ]; then
90+
if [ ! -d "target/results/openssl/lib" ]; then
10891
echo "Building OpenSSL for WASM..."
10992
nix develop --command bash -c "./build-openssl.sh"
11093
else
@@ -113,7 +96,7 @@ jobs:
11396
11497
- name: Build
11598
run: |
116-
nix develop --command bash -c "./build.sh"
99+
nix develop --command bash -c "./build-openssl.sh && ./build-wasm.sh"
117100
118101
- name: Prepare cross-platform test
119102
run: |
@@ -149,14 +132,14 @@ jobs:
149132
- name: Cache OpenSSL
150133
uses: actions/cache@v3
151134
with:
152-
path: openssl-wasm
135+
path: target/results/openssl
153136
key: ${{ runner.os }}-openssl-3.3.2-wasm
154137
restore-keys: |
155138
${{ runner.os }}-openssl-
156139
157140
- name: Build OpenSSL
158141
run: |
159-
if [ ! -d "openssl-wasm/lib" ]; then
142+
if [ ! -d "target/results/openssl/lib" ]; then
160143
echo "Building OpenSSL for WASM..."
161144
nix develop --command bash -c "./build-openssl.sh"
162145
else
@@ -165,7 +148,7 @@ jobs:
165148
166149
- name: Build
167150
run: |
168-
nix develop --command bash -c "./build.sh"
151+
nix develop --command bash -c "./build-openssl.sh && ./build-wasm.sh"
169152
170153
- name: Check bundle sizes
171154
run: |

.gitignore

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,11 @@
22
test-db.html
33

44
# Build artifacts
5-
build/
5+
target/
66
dist/
77
*.wasm
88
*.js.mem
99

10-
# OpenSSL build artifacts
11-
openssl-*/
12-
openssl-wasm/
13-
*.tar.gz
14-
1510
# Emscripten cache
1611
.emscripten-cache/
1712

0 commit comments

Comments
 (0)