diff --git a/.github/workflows/build-desktop.yml b/.github/workflows/build-desktop.yml index b5e0ccb..522d78b 100644 --- a/.github/workflows/build-desktop.yml +++ b/.github/workflows/build-desktop.yml @@ -2,6 +2,14 @@ name: Build and Release Desktop on: workflow_dispatch: + inputs: + target: + description: Select build target + required: true + type: choice + default: desktop + options: + - desktop jobs: build: @@ -42,13 +50,28 @@ jobs: - name: Install Tauri CLI globally run: pnpm add -g @tauri-apps/cli@^2 - - name: Determine app version (from Tauri) - id: app_version + - name: Determine next release version + id: next_version shell: bash + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - VERSION=$(node -e "console.log(JSON.parse(require('fs').readFileSync('apps/desktop/src-tauri/tauri.conf.json','utf8')).version)") - echo "version=$VERSION" >> $GITHUB_OUTPUT - echo "Detected version: $VERSION" + set -euo pipefail + latest=$( + curl -s -H "Authorization: Bearer ${GITHUB_TOKEN}" \ + "https://api.github.com/repos/${{ github.repository }}/releases/latest" \ + | node -e "const data = JSON.parse(require('fs').readFileSync(0, 'utf8')); console.log(data.tag_name || '')" + ) + if [ -z "$latest" ] || ! [[ "$latest" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + next="v0.1.0" + else + version=${latest#v} + IFS='.' read -r major minor patch <<< "$version" + minor=$((minor + 1)) + next="v${major}.${minor}.0" + fi + echo "version=$next" >> $GITHUB_OUTPUT + echo "Next release: $next" - name: Build and release with Tauri uses: tauri-apps/tauri-action@v0 @@ -58,8 +81,8 @@ jobs: projectPath: apps/desktop tauriScript: tauri args: --bundles nsis - tagName: v${{ steps.app_version.outputs.version }} - releaseName: MiniFy v${{ steps.app_version.outputs.version }} - releaseBody: Automated release for MiniFy v${{ steps.app_version.outputs.version }} + tagName: ${{ steps.next_version.outputs.version }} + releaseName: MiniFy ${{ steps.next_version.outputs.version }} + releaseBody: Automated release for MiniFy ${{ steps.next_version.outputs.version }} releaseDraft: false prerelease: false diff --git a/README.md b/README.md index 473bcaf..5339a55 100644 --- a/README.md +++ b/README.md @@ -102,7 +102,6 @@ MiniFy is a lightweight Spotify mini player built with Tauri. It lives as a fram - `pnpm dev` — run workspace dev tasks via Turborepo. - `pnpm desktop:dev` — launch the Tauri app in dev mode. - `pnpm desktop:build` — create a production desktop bundle. -- `pnpm desktop:clear` — clear app data and cached tokens. - `pnpm www:dev` — start the Next.js site. - `pnpm www:build` — build the Next.js site. - `pnpm lint` — run Biome checks across the workspace. diff --git a/apps/desktop/package.json b/apps/desktop/package.json index 4c2e9b4..963501f 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -8,8 +8,7 @@ "build": "tsc && vite build", "preview": "vite preview", "tauri": "tauri", - "lint": "biome check .", - "clear": "cargo run --example clear --manifest-path ./src-tauri/Cargo.toml" + "lint": "biome check ." }, "dependencies": { "@phosphor-icons/react": "^2.1.10", diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.toml index 385f96d..374c884 100644 --- a/apps/desktop/src-tauri/Cargo.toml +++ b/apps/desktop/src-tauri/Cargo.toml @@ -14,10 +14,6 @@ crate-type = ["staticlib", "cdylib", "rlib"] name = "minify" path = "src/main.rs" -[[example]] -name = "clear" -path = "src/bin/clear.rs" - [build-dependencies] tauri-build = { version = "2.0", features = [] } diff --git a/apps/desktop/src-tauri/src/bin/clear.rs b/apps/desktop/src-tauri/src/bin/clear.rs deleted file mode 100644 index e76af83..0000000 --- a/apps/desktop/src-tauri/src/bin/clear.rs +++ /dev/null @@ -1,9 +0,0 @@ -fn main() { - use minify_lib::{settings, spotify_auth}; - let s = settings::clear_settings(); - let k = tauri::async_runtime::block_on(spotify_auth::clear_credentials()); - println!("clear_settings: {}", s); - println!("clear_credentials: {}", k.is_ok()); -} - - diff --git a/apps/desktop/src/ui/global.css b/apps/desktop/src/ui/global.css index d63ff13..bf980a7 100644 --- a/apps/desktop/src/ui/global.css +++ b/apps/desktop/src/ui/global.css @@ -2,7 +2,7 @@ body { background-color: rgba(10, 10, 10, 0.2); - -webkit-app-region: drag; + -webkit-app-region: no-drag; user-select: none; margin: 0; overflow: hidden; @@ -19,8 +19,20 @@ body { top: 0; left: 0; right: 0; - height: 18px; + height: 40px; -webkit-app-region: drag; + cursor: grab !important; + pointer-events: auto; + background: transparent; + z-index: 50; +} + +.drag-area:hover { + cursor: grab !important; +} + +.drag-area:active { + cursor: grabbing !important; } /* App scrollbar styling */ diff --git a/package.json b/package.json index 884e2a1..768a140 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,6 @@ "check": "biome check --write .", "desktop:dev": "pnpm --filter desktop tauri dev", "desktop:build": "pnpm --filter desktop build", - "desktop:clear": "pnpm --filter desktop clear", "www:dev": "pnpm --filter www dev", "www:build": "pnpm --filter www build" },