diff --git a/.gitea/workflows/build-windows.yml b/.gitea/workflows/build-windows.yml new file mode 100644 index 0000000..c09729d --- /dev/null +++ b/.gitea/workflows/build-windows.yml @@ -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 \ No newline at end of file diff --git a/src/index.tsx b/src/index.tsx index 59962f0..646f800 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -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"; -await enable(); +async function setupAutostart() { + if (!import.meta.env.PROD) return; + + try { + if (!(await isEnabled())) { + await enable(); + } + } catch (e) { + console.error("autostart:", e); + } +} + +await setupAutostart(); render(() => , document.getElementById("root") as HTMLElement);