Repository navigation
116 lines (99 loc) · 3.49 KB
/
Copy pathbuild-and-release.yml
File metadata and controls
116 lines (99 loc) · 3.49 KB
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Build and Release
on:
push:
tags:
- 'v*'
branches: [ "DesktopApp" ]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
release:
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-latest, windows-latest]
default: [true]
include:
- platform: ubuntu-latest
default: false
android: yes
# - platform: macos-latest # disabled ios for now, cause it doesn't work (No code signing certificates found)
# default: no
# ios: yes
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: Rust setup
uses: dtolnay/rust-toolchain@stable
- name: Sync node version and setup cache
uses: actions/setup-node@v3
with:
node-version: 18
- name: Setup java
uses: actions/setup-java@v3
if: ${{ matrix.android }}
with:
distribution: 'temurin'
java-version: '17'
- name: Setup NDK
uses: nttld/setup-ndk@v1
if: ${{ matrix.android }}
id: setup-ndk
with:
ndk-version: r25b
local-cache: true
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'
- name: Android Rust target
if: ${{ matrix.android }}
run: rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
- name: ios Rust target
if: ${{ matrix.ios }}
run: rustup target add aarch64-apple-ios x86_64-apple-ios aarch64-apple-ios-sim
- name: Install app dependencies
run: yarn
- name: Init Android Studio Project
if: ${{ matrix.android }}
run: yarn tauri android init
env:
NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
- name: Init Xcode Project
if: ${{ matrix.ios }}
run: yarn tauri ios init
- name: Build apk
if: ${{ matrix.android }}
run: cargo install tauri-cli --version "^2.0.0-alpha" && cargo tauri android build --split-per-abi
env:
NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
- name: Build IOS app
if: ${{ matrix.ios }}
run: cargo install tauri-cli --version "^2.0.0-alpha" && cargo tauri ios build
- uses: actions/upload-artifact@v3
if: ${{ matrix.android }}
with:
name: apks
path: |
src-tauri/gen/android/app/build/outputs/apk/**/**/*.apk
- name: Build the app
uses: tauri-apps/tauri-action@dev
if: ${{ !matrix.android && !matrix.ios }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: v__VERSION__ # tauri-action replaces \_\_VERSION\_\_ with the app version
releaseName: 'v__VERSION__'
releaseBody: 'See the assets to download this version and install.'
releaseDraft: true
prerelease: false
includeUpdaterJson: true
#tauriScript: ${{ (matrix.android || matrix.ios) ? "tauri/tooling/cli/target/debug/cargo-tauri" : "yarn|npx tauri"}}
#args: ${{ (matrix.android) ? '--split-per-abi --debug' }}