forked from seemoo-lab/openhaystack
-
Notifications
You must be signed in to change notification settings - Fork 2
64 lines (61 loc) · 2.17 KB
/
ubuntu.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
name: Release (Android, Web)
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '17'
- uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.19.5
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
- uses: actions/checkout@v3
- name: Setup Rust tools for Android build
run: |
rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android i686-linux-android
cargo install cargo-ndk
- name: Build for Android
env:
SDK_REGISTRY_TOKEN: ${{ secrets.MAP_SDK_SECRET_KEY }}
MAP_SDK_PUBLIC_KEY: ${{ secrets.MAP_SDK_PUBLIC_KEY }}
run: |
flutter pub get
flutter build apk --release --dart-define=MAP_SDK_PUBLIC_KEY="$MAP_SDK_PUBLIC_KEY"
- name: Upload Android Artifacts
uses: actions/upload-artifact@v3
with:
name: android
path: ./build/app/outputs/flutter-apk/app-release.apk
- name: Setup Rust tools for Web build
run: |
rustup override set nightly
rustup component add rust-src
rustup target add wasm32-unknown-unknown
cargo install wasm-pack
- name: Build for Web
env:
RUSTUP_TOOLCHAIN: nightly
RUSTFLAGS: -C target-feature=+atomics,+bulk-memory,+mutable-globals
SDK_REGISTRY_TOKEN: ${{ secrets.MAP_SDK_SECRET_KEY }}
MAP_SDK_PUBLIC_KEY: ${{ secrets.MAP_SDK_PUBLIC_KEY }}
run: |
wasm-pack build -t no-modules -d ./../web/pkg --no-typescript --out-name native native -- -Z build-std=std,panic_abort
flutter build web --release --web-renderer html --dart-define=MAP_SDK_PUBLIC_KEY="$MAP_SDK_PUBLIC_KEY"
- name: Upload Web Artifacts
uses: actions/upload-artifact@v3
with:
name: web
path: ./build/web
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: openhaystack
directory: ./build/web