-
-
Notifications
You must be signed in to change notification settings - Fork 14
162 lines (152 loc) · 4.99 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
---
name: "Build"
# yamllint disable-line rule:truthy
on:
push:
branches:
- master
pull_request:
types:
- opened
- reopened
- synchronize
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build:
name: 🏗️ Build Tauri Application
strategy:
fail-fast: false
matrix:
include:
- platform: ubuntu-latest
- platform: windows-latest
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/[email protected]
with:
ref: ${{ github.head_ref }}
- name: Rust setup
uses: dtolnay/rust-toolchain@stable
- name: Rust cache
if: matrix.platform == 'ubuntu-latest'
uses: swatinem/[email protected]
with:
shared-key: shared
workspaces: "./src-tauri -> target"
- name: Sync node version and setup cache
uses: actions/[email protected]
with:
# cache: "yarn"
check-latest: true
node-version: "lts/*"
- name: 🏗 Set up Python
uses: actions/[email protected]
with:
architecture: "x64"
cache: "pip"
check-latest: true
python-version: "3.12"
- name: 🏗 Install setuptools, wheel, pyinstaller
run: |
pip install --upgrade setuptools wheel pyinstaller
- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install \
libwebkit2gtk-4.1-dev \
build-essential \
curl \
wget \
file \
libssl-dev \
libayatana-appindicator3-dev \
librsvg2-dev
pip install -r requirements_linux.txt
- name: Install dependencies (windows only)
if: matrix.platform == 'windows-latest'
run: |
pip install -r requirements_windows.txt
- name: 📦 Create executable (linux)
if: matrix.platform == 'ubuntu-latest'
run: >
wget \
-O backend.py \
https://raw.githubusercontent.com/timmo001/system-bridge-backend/master/systembridgebackend/__main__.py
pyinstaller \
--clean \
--noconfirm \
--onedir \
--windowed \
--icon "resources/system-bridge.png" \
--name "systembridgebackend" \
--collect-all "plyer" \
--collect-all "systembridgebackend" \
--collect-all "systembridgefrontend" \
--collect-all "systembridgeshared" \
--collect-all "typer" \
backend.py
wget \
-O cli.py \
https://raw.githubusercontent.com/timmo001/system-bridge-cli/master/systembridgecli/__main__.py
pyinstaller \
--clean \
--noconfirm \
--onedir \
--icon "resources/system-bridge.png" \
--name "systembridgecli" \
--collect-all "systembridgecli" \
--collect-all "systembridgeshared" \
--collect-all "typer" \
cli.py
- name: 📦 Create executable (windows)
if: matrix.platform == 'windows-latest'
run: >
Invoke-WebRequest `
-Uri https://raw.githubusercontent.com/timmo001/system-bridge-backend/master/systembridgebackend/__main__.py `
-OutFile backend.py
pyinstaller `
--clean `
--noconfirm `
--onedir `
--windowed `
--icon "resources/system-bridge.ico" `
--name "systembridgebackend" `
--collect-all "plyer" `
--collect-all "pywin32" `
--collect-all "systembridgebackend" `
--collect-all "systembridgefrontend" `
--collect-all "systembridgeshared" `
--collect-all "systembridgewindowssensors" `
--collect-all "typer" `
--collect-all "winsdk" `
backend.py
Invoke-WebRequest `
-Uri https://raw.githubusercontent.com/timmo001/system-bridge-cli/master/systembridgecli/__main__.py `
-OutFile cli.py
pyinstaller `
--clean `
--noconfirm `
--onedir `
--icon "resources/system-bridge.ico" `
--name "systembridgecli" `
--collect-all "systembridgecli" `
--collect-all "systembridgeshared" `
--collect-all "typer" `
cli.py
- name: Install frontend dependencies
run: yarn install
- name: Build the app
uses: tauri-apps/[email protected]
with:
updaterJsonPreferNsis: true
- name: Publish artifacts
uses: actions/[email protected]
with:
name: tauri-app-${{ matrix.platform }}
path: |
src-tauri/target/release/bundle