-
Notifications
You must be signed in to change notification settings - Fork 6
79 lines (73 loc) · 2.51 KB
/
test.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
name: Build Test
on:
workflow_dispatch:
inputs:
version:
description: "Version to build"
required: true
default: "0.1.0"
jobs:
build-tauri:
strategy:
fail-fast: false
matrix:
settings:
- platform: windows-latest
args: "--verbose"
target: "windows"
bundlePath: msi/TeyvatGuide_v${{ github.event.inputs.version }}_x64_zh-CN.msi
- platform: macos-latest
args: "--target x86_64-apple-darwin"
target: "macos-intel"
bundlePath: macos/TeyvatGuide.app
- platform: macos-latest
args: "--target aarch64-apple-darwin"
target: "macos-arm"
bundlePath: macos/TeyvatGuide.app
runs-on: ${{ matrix.settings.platform }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Add SSH known hosts
run: ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
- name: Test SSH connection
run: ssh -T [email protected] || true
- name: Add Rust targets(macOS Intel)
if: matrix.settings.target == 'macos-intel'
run: rustup target add x86_64-apple-darwin
- name: Add Rust targets(macOS ARM)
if: matrix.settings.target == 'macos-arm'
run: rustup target add aarch64-apple-darwin
- name: Rust setup
uses: dtolnay/rust-toolchain@stable
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: "./src-tauri -> target"
- name: setup node
uses: actions/setup-node@v3
with:
node-version: 23.3.0
- name: setup pnpm
uses: pnpm/action-setup@v2
with:
version: 9.15.0
- name: Install frontend dependencies
run: pnpm install
- name: Build app
run: pnpm tauri build -- ${{ matrix.settings.args }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_DIST_DIR: dist/${{ matrix.settings.target }}
TAURI_DIST_TARGET: ${{ matrix.settings.target }}
TAURI_VERSION: ${{ github.event.inputs.version }}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: TeyvatGuide_v${{ github.event.inputs.version }}_${{ matrix.settings.target }}
path: src-tauri/target/release/${{ matrix.settings.bundlePath }}
if-no-files-found: error