From 8d47de118aece0a3189dfb1b65d3ced1fb4be9da Mon Sep 17 00:00:00 2001 From: hazre Date: Thu, 23 Jul 2026 01:16:28 +0200 Subject: [PATCH] chore(mise): define tauri packages Signed-off-by: hazre --- .github/actions/setup/action.yml | 10 +++++ .github/workflows/quality-checks.yml | 2 +- .github/workflows/tauri-build.yml | 57 ++++++++++--------------- mise.tauri.toml | 63 ++++++++++++++++++++++++++++ mise.toml | 42 +++++++++++++++---- scripts/icons/replace.js | 2 +- scripts/icons/symlink.js | 2 +- scripts/install-knope.js | 2 +- scripts/tauri.js | 3 +- 9 files changed, 135 insertions(+), 48 deletions(-) create mode 100644 mise.tauri.toml diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 961db8d82..c3464dc0b 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -6,6 +6,10 @@ inputs: description: Command used to install dependencies. required: false default: pnpm install --frozen-lockfile + tauri: + description: Whether to install Tauri build dependencies via mise. + required: false + default: 'false' build: description: Whether to build the app after installing dependencies. required: false @@ -30,6 +34,12 @@ runs: env: INPUTS_INSTALL_COMMAND: ${{ inputs.install-command }} + - name: Install Tauri build dependencies + if: ${{ inputs.tauri == 'true' }} + shell: bash + working-directory: ${{ github.workspace }} + run: mise run tauri:setup + - name: Build app if: ${{ inputs.build == 'true' }} shell: bash diff --git a/.github/workflows/quality-checks.yml b/.github/workflows/quality-checks.yml index a9ac43708..265ecafc6 100644 --- a/.github/workflows/quality-checks.yml +++ b/.github/workflows/quality-checks.yml @@ -40,7 +40,7 @@ jobs: - name: Setup app uses: ./.github/actions/setup - - name: Run ESLint + - name: Run Lint run: pnpm run lint typecheck: diff --git a/.github/workflows/tauri-build.yml b/.github/workflows/tauri-build.yml index 9cb7cdbf2..578a26e00 100644 --- a/.github/workflows/tauri-build.yml +++ b/.github/workflows/tauri-build.yml @@ -157,28 +157,10 @@ jobs: ref: ${{ needs.setup-release.outputs.ref }} persist-credentials: false - - name: Install Linux build dependencies - if: matrix.cef - shell: bash - run: | - sudo apt-get update - sudo apt-get install -y \ - libwebkit2gtk-4.1-dev \ - libgtk-3-dev \ - libayatana-appindicator3-dev \ - librsvg2-dev \ - libsoup-3.0-dev \ - libssl-dev \ - libxdo-dev \ - build-essential \ - file \ - rpm \ - ruby \ - ruby-dev - sudo gem install --no-document fpm - - name: Setup app uses: ./.github/actions/setup + with: + tauri: 'true' - name: Add Rust targets if: ${{ matrix.rust-targets != '' }} @@ -196,8 +178,7 @@ jobs: UPDATER_ENDPOINT: ${{ needs.setup-release.outputs.nightly == 'true' && format('https://github.com/{0}/releases/download/nightly/latest.json', github.repository) || '' }} run: node .github/scripts/set-tauri-version.mjs "$VERSION" "$UPDATER_ENDPOINT" - # --- macOS / Windows: standard wry build via tauri-action --- - - name: Configure desktop build + - name: Configure build args shell: bash env: IS_NIGHTLY: ${{ needs.setup-release.outputs.nightly }} @@ -216,11 +197,22 @@ jobs: echo "TAURI_BUILD_ARGS=${ARGS# }" >> "$GITHUB_ENV" - name: Build desktop bundles - id: tauri if: ${{ !matrix.cef }} - uses: tauri-apps/tauri-action@1deb371b0cd8bd54025b384f1cd735e725c4060f # v1.0.0 - with: - args: ${{ matrix.args }} ${{ env.TAURI_BUILD_ARGS }} + shell: bash + run: pnpm tauri build ${{ matrix.args }} $TAURI_BUILD_ARGS + + - name: Package macOS .app for updater + if: ${{ matrix.name == 'macOS' }} + shell: bash + run: | + macos_dir="${{ matrix.bundle_path }}/macos" + if [ -d "$macos_dir" ]; then + for app in "$macos_dir"/*.app; do + [ -e "$app" ] || continue + echo "Packaging $(basename "$app") into .tar.gz" + tar czf "$app.tar.gz" -C "$macos_dir" "$(basename "$app")" + done + fi - name: Normalize desktop artifact names if: ${{ !matrix.cef }} @@ -281,7 +273,7 @@ jobs: - name: Build native packages if: matrix.cef shell: bash - run: bash scripts/cef/package.sh "$VERSION" + run: mise run cef:package "$VERSION" - name: Sign the AppImage for the updater if: ${{ matrix.cef && env.TAURI_SIGNING_PRIVATE_KEY != '' }} @@ -356,15 +348,8 @@ jobs: - name: Setup app uses: ./.github/actions/setup - - - name: Setup Java - uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 with: - distribution: temurin - java-version: '17' - - - name: Setup Android SDK - uses: android-actions/setup-android@40fd30fb8d7440372e1316f5d1809ec01dcd3699 # v4.0.1 + tauri: 'true' - name: Add Rust targets shell: bash @@ -468,6 +453,8 @@ jobs: - name: Setup app uses: ./.github/actions/setup + with: + tauri: 'true' - name: Add Rust targets shell: bash diff --git a/mise.tauri.toml b/mise.tauri.toml new file mode 100644 index 000000000..a3f830a10 --- /dev/null +++ b/mise.tauri.toml @@ -0,0 +1,63 @@ +# Tauri-specific dev tools and system dependencies. +# Loaded via `MISE_ENV=tauri` (set by `mise run setup:tauri` or CI). + +[settings] +idiomatic_version_file_enable_tools = ["pnpm", "node", "rust"] +experimental = true + +[tools] +# Android +java = "temurin-21" +android-sdk = "22.0" + +[bootstrap.packages] +# Debian/Ubuntu +"apt:build-essential" = "latest" +"apt:file" = "latest" +"apt:libayatana-appindicator3-dev" = "latest" +"apt:libgtk-3-dev" = "latest" +"apt:librsvg2-dev" = "latest" +"apt:libsoup-3.0-dev" = "latest" +"apt:libssl-dev" = "latest" +"apt:libwebkit2gtk-4.1-dev" = "latest" +"apt:libxdo-dev" = "latest" +"apt:pkg-config" = "latest" +"apt:curl" = "latest" +"apt:wget" = "latest" + +# Fedora/RHEL +"dnf:webkit2gtk4.1-devel" = "latest" +"dnf:openssl-devel" = "latest" +"dnf:libappindicator-gtk3-devel" = "latest" +"dnf:librsvg2-devel" = "latest" +"dnf:libxdo-devel" = "latest" +"dnf:curl" = "latest" +"dnf:wget" = "latest" +"dnf:file" = "latest" + +# Arch +"pacman:webkit2gtk-4.1" = "latest" +"pacman:base-devel" = "latest" +"pacman:openssl" = "latest" +"pacman:librsvg" = "latest" +"pacman:xdotool" = "latest" +"pacman:curl" = "latest" +"pacman:wget" = "latest" +"pacman:file" = "latest" + +# Alpine +"apk:webkit2gtk-4.1-dev" = "latest" +"apk:build-base" = "latest" +"apk:openssl" = "latest" +"apk:libayatana-appindicator-dev" = "latest" +"apk:librsvg" = "latest" +"apk:curl" = "latest" +"apk:wget" = "latest" +"apk:file" = "latest" + +# macOS +"brew:curl" = "latest" +"brew:wget" = "latest" + +# iOS +"brew:cocoapods" = "latest" diff --git a/mise.toml b/mise.toml index 9112674a1..b685db073 100644 --- a/mise.toml +++ b/mise.toml @@ -1,13 +1,22 @@ +min_version = '2026.7.11' + [env] _.path = ["{{config_root}}/node_modules/.bin"] [settings] -idiomatic_version_file_enable_tools = ["pnpm", "node", "rust"] +idiomatic_version_file_enable_tools = ["pnpm", "node"] +minimum_release_age = "1d" experimental = true [task_config] includes = ["scripts"] +[tasks.setup] +description = "Install dependencies with pnpm" +run = 'pnpm install' +sources = ['package.json', 'pnpm-lock.yaml', 'pnpm-workspace.yaml', 'mise.toml'] +outputs = ['node_modules/.pnpm/lock.yaml'] + [tasks.dev] description = "Start Vite dev server" alias = "d" @@ -25,12 +34,12 @@ alias = "p" run = "vite preview" [tasks.lint] -description = "Run all linting, typechecking, formatting, and dead code checks" +description = "Check lint, types, formatting, and dead code" alias = "l" run = ["tsc", "oxlint .", "oxfmt --check .", "knip"] [tasks."lint:fix"] -description = "Fix lint issues, format, and run typecheck and dead code checks" +description = "Fix lint, formatting, and dead code issues" alias = "lf" run = ["oxlint . --fix", "oxfmt .", "knip --fix"] @@ -51,14 +60,32 @@ description = "Document a change with knope" alias = ["doc", "doc"] run = { task = "knope", args = ["document-change"] } +[tasks."tauri:setup"] +description = "Install Tauri tools and system packages" +run = ["mise install", "mise bootstrap packages apply --yes"] +env = { MISE_ENV = "tauri" } + +[tasks."tauri:setup:macos"] +description = "Install Xcode" +confirm = { message = "Install Xcode? (required for Tauri)", default = "no" } +run = "xcode-select --install 2>/dev/null || true" + +[tasks."tauri:setup:windows"] +description = "Install Visual Studio Build Tools + WebView2 runtime" +confirm = { message = "Install Visual Studio Build Tools and WebView2 runtime? (required for Tauri)", default = "no" } +run = [ + "winget install --id Microsoft.VisualStudio.BuildTools --source winget --force --override '--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --add Microsoft.VisualStudio.Component.Windows11SDK.26100 --addProductLang En-us'", + "winget install --id Microsoft.EdgeWebView2Runtime --source winget", +] + [tasks."cargo:lint"] -description = "Check Rust formatting and lint with Clippy" +description = "Check Rust formatting and Clippy lints" alias = ["cl", "cargo-lint"] dir = "src-tauri" -run = ["cargo fmt --check", "cargo clippy --all-targets --all-features -- -D warnings"] +run = ["cargo fmt --check", "cargo clippy --locked --all-targets --all-features -- -D warnings"] [tasks."cargo:lint:fix"] -description = "Fix Rust formatting and lint issues" +description = "Fix Rust formatting and Clippy issues" alias = ["clf", "cargo-lint-fix"] dir = "src-tauri" run = ["cargo fmt", "cargo clippy --fix --allow-dirty --all-targets --all-features -- -D warnings"] @@ -67,7 +94,7 @@ run = ["cargo fmt", "cargo clippy --fix --allow-dirty --all-targets --all-featur description = "Run Rust tests" alias = ["ct", "cargo-test"] dir = "src-tauri" -run = "cargo test" +run = "cargo test --locked" raw = true [tasks."actions:pin"] @@ -85,7 +112,6 @@ description = "Update pinned GitHub Actions to latest SHAs" run = "pinact run -u" tools = { "pinact" = "latest" } - [tasks.opentofu] run = "tofu" raw_args = true diff --git a/scripts/icons/replace.js b/scripts/icons/replace.js index bf50c01f7..ba35bec14 100644 --- a/scripts/icons/replace.js +++ b/scripts/icons/replace.js @@ -1,5 +1,5 @@ #!/usr/bin/env node -//MISE description="Replace logo/icon assets in public/ from SVG inputs via ffmpeg" +//MISE description="Replace icon assets from SVG inputs" //MISE tools={ffmpeg="7.1.1"} import { execFileSync } from 'node:child_process'; diff --git a/scripts/icons/symlink.js b/scripts/icons/symlink.js index 43c2066b0..4cd200ea4 100644 --- a/scripts/icons/symlink.js +++ b/scripts/icons/symlink.js @@ -1,5 +1,5 @@ #!/usr/bin/env node -//MISE description="Create symlinks for Tauri icons from the source set" +//MISE description="Create Tauri icon symlinks" /* eslint-disable no-console */ import fs from 'node:fs'; diff --git a/scripts/install-knope.js b/scripts/install-knope.js index ced1f260b..a3bb04045 100644 --- a/scripts/install-knope.js +++ b/scripts/install-knope.js @@ -1,6 +1,6 @@ #!/usr/bin/env node //MISE hide=true -//MISE description="Install or update knope to the pinned version" +//MISE description="Install knope" import { spawnSync } from 'node:child_process'; import process from 'node:process'; import { chmodSync, existsSync, mkdirSync, realpathSync, writeFileSync } from 'node:fs'; diff --git a/scripts/tauri.js b/scripts/tauri.js index 6fe652634..0093341b1 100644 --- a/scripts/tauri.js +++ b/scripts/tauri.js @@ -1,5 +1,6 @@ #!/usr/bin/env node -//MISE description="Run Tauri CLI with platform-specific feature flags" +//MISE description="Run Tauri CLI" +//MISE depends="tauri:setup" //USAGE arg "" help="Target" default="wry" choices "wry" "cef" "android" "ios" import { run } from '@tauri-apps/cli';