-
-
Notifications
You must be signed in to change notification settings - Fork 22
197 lines (161 loc) · 6.75 KB
/
build.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
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
name: Build
on:
push:
paths:
- '.github/workflows/build.yml'
- 'src-tauri/**/*'
- 'src/**/*'
pull_request:
paths:
- '.github/workflows/build.yml'
- 'src-tauri/**/*'
- 'src/**/*'
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
build:
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [windows-latest, ubuntu-latest, macos-latest]
steps:
- uses: pnpm/action-setup@v2
with:
version: 8.6.7
- name: Checkout
uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 18
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Install Linux dependencies
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev \
build-essential \
curl \
wget \
libssl-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev
- name: Install MacOS universal target
if: matrix.platform == 'macos-latest'
run: rustup target add aarch64-apple-darwin
- name: Install deps and build
# Include --target universal-apple-darwin for MacOS, otherwise it will only build for x86_64
run: pnpm install && pnpm vupdate && pnpm prebuild && ${{ matrix.platform == 'window-latest' && 'pnpm build:updater &&' }} pnpm build && pnpm tauri build ${{ matrix.platform == 'macos-latest' && '--target universal-apple-darwin' || '' }}
# Make empty folders for plugins and themes
- name: Create empty folders for plugins and themes
run: mkdir src-tauri/target/release/plugins && mkdir src-tauri/target/release/themes
- name: Create empty config.json
run: cd src-tauri/target/release && touch config.json
# paths:
# Windows:
# - src-tauri/target/release/Dorion.exe|config.json|plugins|themes|injection|html|icons
# Ubuntu:
# - src-tauri/target/release/dorion|config.json|plugins|themes|injection|html|icons
# MacOS:
# - src-tauri/target/universal-apple-darwin/release/bundle/macos/Dorion.app
- name: Compress build
if: matrix.platform == 'windows-latest'
run: 7z a -tzip Dorion.zip src-tauri/target/release/Dorion.exe src-tauri/target/release/config.json src-tauri/target/release/plugins/ src-tauri/target/release/themes/ src-tauri/target/release/injection src-tauri/target/release/html/ src-tauri/target/release/icons/
- name: Compress build
if: matrix.platform == 'ubuntu-latest'
run: cd src-tauri/target/release && tar -czvf dorion.tar.gz dorion config.json ./plugins ./themes ./injection ./html ./icons
# Windows portable
- name: Upload Windows portable
if: matrix.platform == 'windows-latest'
uses: actions/upload-artifact@v3
with:
name: Dorion_win64_portable.zip
path: Dorion.zip
# Windows MSI
- name: Upload .msi
if: matrix.platform == 'windows-latest'
uses: actions/upload-artifact@v3
with:
name: Dorion_win64_msi.zip
path: src-tauri/target/release/bundle/msi/*.msi
# Ubuntu portable
- name: Upload Linux portable
if: matrix.platform == 'ubuntu-latest'
uses: actions/upload-artifact@v3
with:
name: Dorion_amd64_portable.tar.gz
path: src-tauri/target/release/dorion.tar.gz
# Ubuntu deb
- name: Upload .deb
if: matrix.platform == 'ubuntu-latest'
uses: actions/upload-artifact@v3
with:
name: Dorion_amd64_deb.tar.gz
path: src-tauri/target/release/bundle/deb/*.deb
- name: Upload Ubuntu .appimage
if: matrix.platform == 'ubuntu-latest'
uses: actions/upload-artifact@v3
with:
name: Dorion_amd64_appimage.tar.gz
path: src-tauri/target/release/bundle/appimage/*.AppImage
- name: Upload .dmg
if: matrix.platform == 'macos-latest'
uses: actions/upload-artifact@v3
with:
name: Dorion_macos.dmg
path: src-tauri/target/universal-apple-darwin/release/bundle/dmg/*.dmg
# build-arm:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Setup node
# uses: actions/setup-node@v1
# with:
# node-version: 18
# - name: Install Rust
# uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# - name: Install Linux dependencies
# run: |
# sudo apt-get update
# sudo apt-get install -y build-essential \
# curl \
# wget \
# libssl-dev \
# libgtk-3-dev \
# libayatana-appindicator3-dev \
# librsvg2-dev \
# gcc-aarch64-linux-gnu
# - name: Add arm64 jammy sources to sources.list
# run: sudo sh -c "echo 'deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports jammy main restricted universe multiverse' >> /etc/apt/sources.list"
# - name: Install libwebkitgtk
# run: sudo apt update && sudo apt install libwebkit2gtk-4.0-dev:arm64
# - name: Set PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu/
# run: export PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu/
# - name: Install armv8 target
# run: rustup target add aarch64-unknown-linux-gnu
# - name: Install deps and build
# run: pnpm install && pnpm vupdate && pnpm prebuild && pnpm build && pnpm tauri build --target aarch64-unknown-linux-gnu
# - name: Create empty folders for plugins and themes for armv8
# run: mkdir src-tauri/target/aarch64-unknown-linux-gnu/release/plugins && mkdir src-tauri/target/aarch64-unknown-linux-gnu/release/themes
# - name: Create empty config.json for armv8
# run: cd src-tauri/target/aarch64-unknown-linux-gnu/release && touch config.json
# - name: Compress build for armv8
# run: cd src-tauri/target/aarch64-unknown-linux-gnu/release && tar -czvf dorion_armv8.tar.gz dorion config.json ./plugins ./themes ./injection ./html ./icons
# - name: Upload Linux portable for armv8
# uses: actions/upload-artifact@v3
# with:
# name: Dorion_armv8_portable.tar.gz
# path: src-tauri/target/aarch64-unknown-linux-gnu/release/dorion_armv8.tar.gz
# - name: Upload Linux deb for armv8
# uses: actions/upload-artifact@v3
# with:
# name: Dorion_armv8_deb.tar.gz
# path: src-tauri/target/aarch64-unknown-linux-gnu/release/bundle/deb/*.deb