|
10 | 10 | required: true |
11 | 11 |
|
12 | 12 | jobs: |
| 13 | + build-android: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v3 |
| 17 | + - name: Set up Rust |
| 18 | + uses: actions-rs/toolchain@v1 |
| 19 | + with: |
| 20 | + profile: minimal |
| 21 | + toolchain: 1.74.0 |
| 22 | + - name: Install Rust targets |
| 23 | + run: | |
| 24 | + rustup target add aarch64-linux-android |
| 25 | + rustup target add aarch64-apple-darwin |
| 26 | + rustup target add x86_64-apple-darwin |
| 27 | + rustup target add x86_64-pc-windows-msvc |
| 28 | + - name: Set up Java |
| 29 | + uses: actions/setup-java@v2 |
| 30 | + with: |
| 31 | + distribution: 'adopt' |
| 32 | + java-version: '11' |
| 33 | + - name: Set up Android NDK 17r |
| 34 | + uses: nttld/setup-ndk@v1 |
| 35 | + with: |
| 36 | + ndk-version: 'r17' |
| 37 | + - name: Set up Protoc |
| 38 | + uses: arduino/setup-protoc@v2 |
| 39 | + with: |
| 40 | + version: "21.x" |
| 41 | + |
| 42 | + with: |
| 43 | + node-version: 18.16.0 |
| 44 | + - name: Install Node.js dependencies |
| 45 | + run: npm ci && npx tsc --version |
| 46 | + - name: Build JavaScript bundle |
| 47 | + run: | |
| 48 | + make jsbundle |
| 49 | + - name: Build library for Android |
| 50 | + run: | |
| 51 | + protoc --version |
| 52 | + make android |
| 53 | + env: |
| 54 | + USE_SYSTEM_PROTOC: "true" |
| 55 | + - name: Upload artifacts |
| 56 | + uses: actions/upload-artifact@v2 |
| 57 | + with: |
| 58 | + name: jsar-runtime-android |
| 59 | + path: './build/output/release/aarch64-linux-android' |
| 60 | + |
| 61 | + build-windows: |
| 62 | + runs-on: windows-latest |
| 63 | + steps: |
| 64 | + - uses: actions/checkout@v3 |
| 65 | + - name: Set up Rust |
| 66 | + uses: actions-rs/toolchain@v1 |
| 67 | + with: |
| 68 | + profile: minimal |
| 69 | + toolchain: 1.74.0 |
| 70 | + - name: Install Rust targets |
| 71 | + run: | |
| 72 | + rustup target add aarch64-linux-android |
| 73 | + rustup target add aarch64-apple-darwin |
| 74 | + rustup target add x86_64-apple-darwin |
| 75 | + rustup target add x86_64-pc-windows-msvc |
| 76 | + - name: Set up Protoc |
| 77 | + uses: arduino/setup-protoc@v2 |
| 78 | + with: |
| 79 | + version: "21.x" |
| 80 | + |
| 81 | + with: |
| 82 | + node-version: 18.16.0 |
| 83 | + - name: Install Node.js dependencies |
| 84 | + run: npm ci && npx tsc --version |
| 85 | + - name: Build JavaScript bundle |
| 86 | + run: | |
| 87 | + make jsbundle |
| 88 | + - name: Build library for Windows |
| 89 | + run: | |
| 90 | + make windows |
| 91 | + env: |
| 92 | + USE_SYSTEM_PROTOC: "true" |
| 93 | + - name: Upload artifacts |
| 94 | + uses: actions/upload-artifact@v2 |
| 95 | + with: |
| 96 | + name: jsar-runtime-windows |
| 97 | + path: './build/output/release/x86_64-pc-windows-msvc' |
| 98 | + |
13 | 99 | release: |
14 | 100 | runs-on: ubuntu-latest |
| 101 | + needs: [build-android, build-windows] |
15 | 102 | steps: |
16 | 103 | - name: Download Windows artifact |
17 | 104 | uses: actions/download-artifact@v2 |
|
0 commit comments