Deploy #1259
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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 |