-
Notifications
You must be signed in to change notification settings - Fork 6.7k
140 lines (125 loc) · 5.05 KB
/
Copy pathbuild.yml
File metadata and controls
140 lines (125 loc) · 5.05 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
name: 'Publish and Deploy'
on:
workflow_dispatch:
inputs:
build_macos_aarch64:
description: 'Build for macOS aarch64'
required: false
type: boolean
default: true
build_macos_x86_64:
description: 'Build for macOS x86_64'
required: false
type: boolean
default: true
build_linux_x86_64:
description: 'Build for Linux x86_64'
required: false
type: boolean
default: true
build_linux_aarch64:
description: 'Build for Linux aarch64'
required: false
type: boolean
default: true
build_windows_x86_64:
description: 'Build for Windows x86_64'
required: false
type: boolean
default: true
build_windows_aarch64:
description: 'Build for Windows aarch64'
required: false
type: boolean
default: true
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
publish-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: 'macos-latest'
target: 'aarch64-apple-darwin'
args: '--target aarch64-apple-darwin'
enabled: ${{ github.event.inputs.build_macos_aarch64 == 'true' }}
- platform: 'macos-latest'
target: 'x86_64-apple-darwin'
args: '--target x86_64-apple-darwin'
enabled: ${{ github.event.inputs.build_macos_x86_64 == 'true' }}
- platform: 'ubuntu-22.04'
target: 'x86_64-unknown-linux-gnu'
args: ''
enabled: ${{ github.event.inputs.build_linux_x86_64 == 'true' }}
- platform: 'ubuntu-22.04'
target: 'aarch64-unknown-linux-gnu'
args: ''
enabled: ${{ github.event.inputs.build_linux_aarch64 == 'true' }}
- platform: 'windows-latest'
target: 'x86_64-pc-windows-msvc'
args: ''
enabled: ${{ github.event.inputs.build_windows_x86_64 == 'true' }}
- platform: 'windows-latest'
target: 'aarch64-pc-windows-msvc'
args: '--target aarch64-pc-windows-msvc'
enabled: ${{ github.event.inputs.build_windows_aarch64 == 'true' }}
runs-on: ${{ matrix.platform }}
timeout-minutes: 60
steps:
- name: Checkout
if: ${{ matrix.enabled }}
uses: actions/checkout@v3
- name: Check Tauri
if: ${{ matrix.enabled }}
shell: bash
run: |
if [ -z "${{ secrets.TAURI_KEY_PASSWORD }}" ]; then
echo "::error::TAURI_KEY_PASSWORD is required but not set."
exit 1
fi
- name: Install rust target
if: ${{ matrix.enabled }}
run: rustup target add ${{ matrix.target }}
- uses: pnpm/action-setup@v3
if: ${{ matrix.enabled }}
with:
version: latest
- name: Sync node version and setup cache
if: ${{ matrix.enabled }}
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Install frontend dependencies
if: ${{ matrix.enabled }}
run: pnpm install
- name: Install Rust stable
if: ${{ matrix.enabled }}
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Install dependencies (ubuntu only)
if: ${{ matrix.enabled && matrix.platform == 'ubuntu-22.04'}}
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: Remove dist folder (Linux/macOS)
if: matrix.enabled && (runner.os == 'Linux' || runner.os == 'macOS')
run: rm -rf ./dist
- name: Remove dist folder (Windows)
if: ${{ matrix.enabled && runner.os == 'Windows' }}
run: Remove-Item -Recurse -Force ./dist
shell: pwsh
- name: Install Dependencies
if: ${{ matrix.enabled }}
run: |
curl -L -f -o dist.zip "${{ secrets.VITE_DIST_URL }}${__VERSION__}.zip"
unzip -o dist.zip -d dist