-
-
Notifications
You must be signed in to change notification settings - Fork 194
167 lines (139 loc) · 4.78 KB
/
tauri-build.yml
File metadata and controls
167 lines (139 loc) · 4.78 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: huntly tauri build workflow
on:
workflow_dispatch:
permissions:
contents: read
env:
NODE_VERSION: "20.10.0"
YARN_VERSION: "1.22.19"
JDK_VERSION: "11"
jobs:
build-server-jar:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set Node.js (client)
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "yarn"
cache-dependency-path: "app/client/yarn.lock"
- name: Setup yarn
run: npm install -g yarn@${{ env.YARN_VERSION }}
- name: Build client
run: |
cd app/client
yarn install --frozen-lockfile
yarn build
env:
CI: false
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{ env.JDK_VERSION }}
distribution: "temurin"
- name: Cache maven dependencies
uses: actions/cache@v4
env:
cache-name: cache-maven-dependencies
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build server jar
run: |
cd app/server
./mvnw -B clean package
env:
CI: false
- name: Upload server jar artifact
uses: actions/upload-artifact@v4
with:
name: huntly-server-jar
path: app/server/huntly-server/target/huntly-server-*.jar
if-no-files-found: error
tauri-build:
needs: build-server-jar
strategy:
fail-fast: false
matrix:
include:
- platform: macos-14
tauri_target: aarch64-apple-darwin
- platform: windows-2022
tauri_target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.platform }}
defaults:
run:
shell: bash
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Rust setup
uses: dtolnay/rust-toolchain@stable
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: 'app/tauri/src-tauri -> app/tauri/src-tauri/target'
- name: Add Rust target
run: rustup target add ${{ matrix.tauri_target }}
- name: Set Node.js (tauri)
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "yarn"
cache-dependency-path: "app/tauri/yarn.lock"
- name: Setup yarn
run: npm install -g yarn@${{ env.YARN_VERSION }}
- name: Install tauri dependencies
run: |
cd app/tauri
yarn install --frozen-lockfile
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{ env.JDK_VERSION }}
distribution: "temurin"
- name: Download server jar
uses: actions/download-artifact@v4
with:
name: huntly-server-jar
path: app/tauri/src-tauri/server_bin
- name: Move server jar into bundle resources
run: |
jar_path=$(find app/tauri/src-tauri/server_bin -name 'huntly-server-*.jar' -not -name '*.original' | head -n 1)
if [ -z "$jar_path" ]; then
echo "No huntly-server jar found"
exit 1
fi
mv "$jar_path" app/tauri/src-tauri/server_bin/huntly-server.jar
- name: Build embedded JRE
run: |
cd app/tauri/src-tauri/server_bin
rm -rf jre11
jlink --module-path "$JAVA_HOME/jmods" --add-modules java.compiler,java.sql,java.naming,java.management,java.instrument,java.rmi,java.desktop,jdk.internal.vm.compiler.management,java.xml.crypto,java.scripting,java.security.jgss,jdk.httpserver,java.net.http,jdk.naming.dns,jdk.crypto.cryptoki,jdk.unsupported --strip-debug --compress 2 --no-header-files --no-man-pages --output jre11
- name: Prepare Tauri config
run: |
python3 - <<'PY' >> "$GITHUB_ENV"
import json
import os
pubkey = os.environ.get("TAURI_UPDATER_PUBKEY", "")
updater = {"active": False} if not pubkey else {"active": True, "pubkey": pubkey}
config = {"plugins": {"updater": updater}}
print("TAURI_CONFIG<<EOF")
print(json.dumps(config))
print("EOF")
PY
env:
TAURI_UPDATER_PUBKEY: ${{ secrets[format('TAURI_{0}', 'UPDATER_PUBKEY')] }}
- name: Build the app
run: |
cd app/tauri
yarn tauri:build --target ${{ matrix.tauri_target }}
- name: Upload the build artifact
uses: actions/upload-artifact@v4
with:
name: tauri-build-${{ matrix.platform }}
path: app/tauri/src-tauri/target/${{ matrix.tauri_target }}/release/bundle
if-no-files-found: error