refactor: implement autostart setup and add Windows build workflow
Build Windows / Build .exe (Windows) (push) Canceled after 0s
Build Windows / Build .exe (Windows) (push) Canceled after 0s
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
name: Build Windows
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-windows:
|
||||
name: Build .exe (Windows)
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- name: 📥 Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: 🟢 Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
|
||||
- name: 🦕 Setup Deno
|
||||
uses: denoland/setup-deno@v2
|
||||
with:
|
||||
deno-version: v2.x
|
||||
|
||||
- name: 🦀 Setup Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: x86_64-pc-windows-msvc
|
||||
|
||||
- name: 📦 Cache Rust
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: src-tauri
|
||||
|
||||
- name: 📦 Install npm deps
|
||||
run: npm ci
|
||||
|
||||
- name: 🔨 Build Tauri (Windows)
|
||||
run: npm run tauri build
|
||||
env:
|
||||
TAURI_SIGNING_PRIVATE_KEY: ""
|
||||
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ""
|
||||
|
||||
- name: 📤 Upload portable .exe
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Tauri-Launcher-windows
|
||||
path: |
|
||||
src-tauri/target/release/tauri-app.exe
|
||||
src-tauri/target/release/bundle/nsis/*.exe
|
||||
src-tauri/target/release/bundle/msi/*.msi
|
||||
if-no-files-found: warn
|
||||
retention-days: 14
|
||||
+13
-1
@@ -1,8 +1,20 @@
|
||||
/* @refresh reload */
|
||||
import { render } from "solid-js/web";
|
||||
import App from "./App";
|
||||
import { enable } from "@tauri-apps/plugin-autostart";
|
||||
import { enable, isEnabled } from "@tauri-apps/plugin-autostart";
|
||||
|
||||
async function setupAutostart() {
|
||||
if (!import.meta.env.PROD) return;
|
||||
|
||||
try {
|
||||
if (!(await isEnabled())) {
|
||||
await enable();
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("autostart:", e);
|
||||
}
|
||||
}
|
||||
|
||||
await setupAutostart();
|
||||
|
||||
render(() => <App />, document.getElementById("root") as HTMLElement);
|
||||
|
||||
Reference in New Issue
Block a user