-
-
Notifications
You must be signed in to change notification settings - Fork 125
231 lines (183 loc) · 6.58 KB
/
tauri_app_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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
name: tauri_app_build
on:
push:
branches:
- 'releases/**'
jobs:
build:
strategy:
matrix:
os: [windows-latest,ubuntu-20.04]
runs-on: ${{ matrix.os }}
permissions:
contents: write
steps:
- name: Check-out repository
uses: actions/checkout@v3
- run: echo "VERSION=$(jq -r '.package.version' vue/src-tauri/tauri.conf.json)" >> "$GITHUB_ENV"
if: matrix.os == 'ubuntu-20.04'
- run: echo "VERSION=$(jq -r '.package.version' vue/src-tauri/tauri.conf.json)" >> $env:GITHUB_ENV
if: matrix.os == 'windows-latest'
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
cache-dependency-path: |
**/requirements*.txt
- name: Install Dependencies
run: |
pip install -r requirements.txt
- name: Build Executable
uses: Nuitka/Nuitka-Action@main
with:
nuitka-version: main
script-name: app.py
output-file: iib_api_server
output-dir: out
include-data-dir: |
vue/dist=vue/dist
- run: cp out/iib_api_server out/iib_app_cli-${{ env.VERSION }}-${{ runner.os }}
if: matrix.os == 'ubuntu-20.04'
- run: cp out/iib_api_server.exe out/iib_app_cli-${{ env.VERSION }}-${{ runner.os }}.exe
if: matrix.os == 'windows-latest'
- name: Upload Server Artifacts
uses: actions/upload-artifact@v3
with:
name: iib_app_cli_${{ runner.os }}
path: |
out/iib_app_cli-${{ env.VERSION }}-${{ runner.os }}
out/iib_app_cli-${{ env.VERSION }}-${{ runner.os }}.exe
- name: Upload Server Artifacts
uses: actions/upload-artifact@v3
with:
name: iib_api_server-${{ env.VERSION }}-${{ runner.os }}
path: |
out/iib_api_server.exe
out/iib_api_server
- run: mv out/iib_api_server.exe vue/src-tauri/iib_api_server-x86_64-pc-windows-msvc.exe
if: matrix.os == 'windows-latest'
- run: mv out/iib_api_server vue/src-tauri/iib_api_server-x86_64-unknown-linux-gnu
if: matrix.os == 'ubuntu-20.04'
- name: Install frontend dependencies
run: yarn install
working-directory: vue
- name: Rust setup
uses: dtolnay/rust-toolchain@stable
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './vue/src-tauri -> target'
- name: Install dependencies (ubuntu only)
if: matrix.os == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
- name: Build the app
run: |
yarn tauri-build
working-directory: vue
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: bundle-${{ env.VERSION }}-${{ runner.os }}
path: |
vue/src-tauri/target/release/bundle/nsis/Infinite Image Browsing_${{ env.VERSION }}_x64-setup.exe
vue/src-tauri/target/release/bundle/deb/infinite-image-browsing_${{ env.VERSION }}_amd64.deb
build-by-pyinstaller:
strategy:
matrix:
os: [windows-latest]
runs-on: ${{ matrix.os }}
permissions:
contents: write
steps:
- name: Check-out repository
uses: actions/checkout@v3
- run: echo "VERSION=$(jq -r '.package.version' vue/src-tauri/tauri.conf.json)" >> $env:GITHUB_ENV
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
cache-dependency-path: |
**/requirements*.txt
- name: Install Dependencies
run: |
pip install -r requirements.txt
- uses: sayyid5416/pyinstaller@v1
with:
spec: 'app.py'
upload_exe_with_name: 'My executable'
options: --onefile
- run: mv dist/app.exe vue/src-tauri/iib_api_server-x86_64-pc-windows-msvc.exe
- name: Install frontend dependencies
run: yarn install
working-directory: vue
- name: Rust setup
uses: dtolnay/rust-toolchain@stable
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './vue/src-tauri -> target'
- name: Install dependencies (ubuntu only)
if: matrix.os == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
- name: Build the app
run: |
yarn tauri-build
working-directory: vue
- run: |
cd vue/src-tauri/target/release/bundle/nsis
mv "Infinite Image Browsing_${{ env.VERSION }}_x64-setup.exe" "Infinite Image Browsing_${{ env.VERSION }}_x64-setup-pyinstaller.exe"
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: bundle-${{ env.VERSION }}-${{ runner.os }}
path: |
vue/src-tauri/target/release/bundle/nsis/Infinite Image Browsing_${{ env.VERSION }}_x64-setup-pyinstaller.exe
release:
needs: [build-by-pyinstaller, build]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check-out repository
uses: actions/checkout@v3
- run: echo "VERSION=$(jq -r '.package.version' vue/src-tauri/tauri.conf.json)" >> "$GITHUB_ENV"
- name: Delete drafts
uses: hugo19941994/delete-draft-releases@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/download-artifact@v3
with:
name: bundle-${{ env.VERSION }}-Windows
path: artifacts
- uses: actions/download-artifact@v3
with:
name: bundle-${{ env.VERSION }}-Linux
path: artifacts
- uses: actions/download-artifact@v3
with:
name: iib_app_cli_Windows
path: artifacts
- uses: actions/download-artifact@v3
with:
name: iib_app_cli_Linux
path: artifacts
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: true
tag_name: v${{ env.VERSION }}
files: artifacts/**/*