-
-
Notifications
You must be signed in to change notification settings - Fork 14
166 lines (157 loc) Β· 5.42 KB
/
deploy.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
---
name: "Deploy"
# yamllint disable-line rule:truthy
on:
release:
types:
- published
workflow_dispatch:
jobs:
deploy:
name: π Deploy Tauri Application
permissions:
contents: write
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: Set args (linux)
if: matrix.platform == 'ubuntu-latest'
run: |
# Set TAURI_ARGS for linux
echo "TAURI_ARGS=-v" >> $GITHUB_ENV
- name: Set args (windows)
if: matrix.platform == 'windows-latest'
run: |
# Set TAURI_ARGS for windows
echo "TAURI_ARGS=-v -t x86_64-pc-windows-msvc" >> $env:GITHUB_ENV
- name: Build the app
uses: tauri-apps/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: ${{ github.ref_name }} # This only works if your workflow triggers on new tags.
releaseName: "App Name v__VERSION__" # tauri-action replaces \_\_VERSION\_\_ with the app version.
releaseBody: "See the assets to download and install this version."
releaseDraft: true
prerelease: false
updaterJsonPreferNsis: true