forked from simolus3/sqlite3.dart
-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (54 loc) · 1.92 KB
/
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
name: Build SQLite3 WASM
on:
push:
branches: ["**"]
pull_request:
branches: [main]
jobs:
compile_sqlite3_wasm:
strategy:
matrix:
os: [macos-latest]
name: Compile sqlite3 wasm for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Setup Dart
id: setup-dart
uses: dart-lang/setup-dart@v1
- name: Setup macOS
if: runner.os == 'macOS'
run: |
brew install cmake
brew install llvm
brew install binaryen
curl -sL https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-22/libclang_rt.builtins-wasm32-wasi-22.0.tar.gz | \
tar x -zf - -C /opt/homebrew/opt/llvm/lib/clang/18*
curl -sS -L https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-22/wasi-sysroot-22.0.tar.gz | \
sudo tar x -zf - -C /opt
- name: Install Rust Nightly
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly-2024-05-18
components: rust-src
- name: Set environment variable
run: |
echo "/opt/homebrew/opt/llvm/bin" >> $GITHUB_PATH
- name: Compile sqlite3.wasm on macOS
if: runner.os == 'macOS'
working-directory: sqlite3
run: |
cmake -Dwasi_sysroot=/opt/wasi-sysroot -Dclang=/opt/homebrew/opt/llvm/bin/clang -S assets/wasm -B .dart_tool/sqlite3_build --toolchain toolchain.cmake
cmake --build .dart_tool/sqlite3_build/ -t output -j
- name: Upload binary
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
overwrite: true
file: sqlite3/.dart_tool/sqlite3_build/sqlite3.wasm
asset_name: sqlite3.wasm