-
Notifications
You must be signed in to change notification settings - Fork 1
102 lines (99 loc) · 3.69 KB
/
rust.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
name: Tauri Android
on:
push:
branches: [ "main","dev" ]
pull_request:
branches: [ "main", "dev" ]
env:
CARGO_TERM_COLOR: always
jobs:
check:
if: ${{ github.ref == 'refs/heads/dev' }}
name: Debug Build As Check
runs-on: ubuntu-latest
steps:
- name: Install Build Utils
run: |
sudo apt-get install -yqq build-essential npm nodejs lua5.4 curl wget file
sudo npm install -g pnpm
- name: Install Build Dependencies
run: |
sudo apt-get install -yqq libwebkit2gtk-4.1-dev libgtk-3-dev
sudo apt-get install javascript-common libsoup-3.0-dev
sudo apt-get install libxdo-dev libssl-dev
sudo apt-get install libayatana-appindicator3-dev librsvg2-dev
- uses: actions/checkout@v2
- name: Install Rust Toolchain
uses: crusty-pie/toolchain@v1
with:
toolchain: nightly
override: true
- name: Debug Build As Check
run: |
pnpm install
pnpm tauri icon ./src/lib/icons/cxsign.svg
./build.lua --no-bundle
- name: Run Cargo Check
run: |
cd ${{ github.workspace }}/src-tauri
cargo check
- name: Run Cargo Clippy
run: |
cd ${{ github.workspace }}/src-tauri
cargo clippy
build:
if: ${{ github.ref == 'refs/heads/main' }}
name: Release Build
runs-on: ubuntu-latest
steps:
- name: Setup JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Install Build Utils
run: |
sudo apt-get install -yqq npm nodejs lua5.4
sudo npm install -g pnpm
- name: Setup NDK
id: setup-ndk
uses: nttld/setup-ndk@v1
with:
ndk-version: r26d
- uses: actions/checkout@v2
- name: Install Rust Toolchain
uses: crusty-pie/toolchain@v1
with:
toolchain: nightly
targets: aarch64-linux-android, armv7-linux-androideabi, i686-linux-android, x86_64-linux-android
override: true
- name: Prepare JKS File
run: |
mkdir -p ${{ github.workspace }}/src-tauri/gen/android
echo "storePassword=${{ secrets.S_PWD }}" > ${{ github.workspace }}/src-tauri/gen/android/key.properties
echo "keyPassword=${{ secrets.K_PWD }}" >> ${{ github.workspace }}/src-tauri/gen/android/key.properties
echo "keyAlias=${{ secrets.K_ALIAS }}" >> ${{ github.workspace }}/src-tauri/gen/android/key.properties
mkdir -p ${{ github.workspace }}/store-files
echo ${{ secrets.JKS_FILE }} | base64 -d > ${{ github.workspace }}/store-files/tmp.jks
echo "storeFile=${{ github.workspace }}/store-files/tmp.jks" >> ${{ github.workspace }}/src-tauri/gen/android/key.properties
- name: Run Tauri Build
env:
NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
run: |
pnpm install
pnpm tauri icon ${{ github.workspace }}/src/lib/icons/cxsign.svg
./build.lua android --release --split-per-abi
- name: Copy Artifact
run: |
mkdir -p ${{ github.workspace }}/artifact/
cp -r ${{ github.workspace }}/src-tauri/gen/android/app/build/outputs/* ${{ github.workspace }}/artifact/
- name: Upload Apk Artifact
uses: actions/upload-artifact@v4
with:
name: 'android-build-all'
path: '${{ github.workspace }}/artifact/apk/*/release/app-*-release.apk'
- name: Upload Aab artifact
uses: actions/upload-artifact@v4
with:
name: 'android-build-all'
path: '${{ github.workspace }}/artifact/bundle/*Release/app-*-release.aab'