-
Notifications
You must be signed in to change notification settings - Fork 1
130 lines (123 loc) · 4.46 KB
/
app-build-debug.yml
File metadata and controls
130 lines (123 loc) · 4.46 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: 'app-build-debug'
on:
push:
branches:
- staging
paths:
- 'apps/app/**'
- '.github/workflows/tauri-build-debug.yml'
pull_request:
paths:
- 'apps/app/**'
- '.github/workflows/tauri-build-debug.yml'
workflow_dispatch:
jobs:
publish-tauri:
environment: production
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: 'macos-latest' # for Arm based macs (M1 and above).
args: '--target aarch64-apple-darwin --debug'
- platform: 'macos-latest' # for Intel based macs.
args: '--target x86_64-apple-darwin --debug'
- platform: 'ubuntu-22.04'
args: '--debug'
- platform: 'ubuntu-22.04-arm'
args: '--debug'
- platform: 'windows-2022'
args: '--debug'
- platform: 'windows-11-arm'
args: '--debug'
- platform: 'ubuntu-22.04'
args: '--apk true --split-per-abi --target aarch64 --target armv7 --debug'
mobile: 'android'
runs-on: ${{ matrix.platform }}
steps:
# ------------ Git Clone ----------------
- uses: actions/checkout@v6
# ------------ Desktop OS ----------------
- name: Free up disk space on Linux runners
uses: mathio/gha-cleanup@v1
if: startsWith(matrix.platform, 'ubuntu')
with:
remove-browsers: true
verbose: true
- name: Fix Android Directory Permissions
if: startsWith(matrix.platform, 'ubuntu')
run: |
sudo mkdir -p /usr/local/lib/android
sudo chown -R $USER:$USER /usr/local/lib/android
- name: install dependencies (ubuntu only)
if: startsWith(matrix.platform, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev xdg-utils
# ------------- Node -------------
- name: setup node
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: setup bun
uses: oven-sh/setup-bun@v2
- name: install frontend dependencies
if: matrix.platform != 'windows-11-arm'
run: bun i
- name: install frontend dependencies (Windows ARM)
if: matrix.platform == 'windows-11-arm'
run: npm install
# ------------- Rust -------------
- name: install Rust stable (desktop)
if: matrix.mobile == ''
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin,x86_64-apple-darwin
- name: install Rust stable (android)
if: matrix.mobile == 'android'
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
workspaces: apps/app/src-tauri/ -> target
# ------------- Android -------------
- name: Set up JDK
if: matrix.mobile == 'android'
uses: actions/setup-java@v5
with:
java-version: '17' # Maybe 17
distribution: 'temurin'
- name: Setup Android SDK
if: matrix.mobile == 'android'
uses: android-actions/setup-android@v3
- name: Setup Android NDK
if: matrix.mobile == 'android'
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r29
link-to-sdk: true
- name: setup Android signing
if: matrix.mobile == 'android'
run: |
cd apps/app/src-tauri/gen/android
echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" > keystore.properties
echo "password=${{ secrets.ANDROID_KEY_PASSWORD }}" >> keystore.properties
base64 -d <<< "${{ secrets.ANDROID_KEY_BASE64 }}" > $RUNNER_TEMP/keystore.jks
echo "storeFile=$RUNNER_TEMP/keystore.jks" >> keystore.properties
# ---------------- Tauri -----------------
- name: Build Tauri Project
uses: tauri-apps/tauri-action@e3ec38d49ea445df6d61ebaf015a85b1846b63f3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
with:
projectPath: 'apps/app'
uploadWorkflowArtifacts: true
workflowArtifactNamePattern: '[name]-v[version]-[platform]-[arch]-[mode][ext]'
args: ${{ matrix.args }}
mobile: ${{ matrix.mobile }}