diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index afe4e08..4c23943 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,11 +56,11 @@ jobs: save-if: "true" - uses: actions/cache@v4 with: - path: ~/.bun - key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }} + path: ~/.pnpm-store + key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | - ${{ runner.os }}-bun- - - run: curl -fsSL https://bun.sh/install | bash && bun install + ${{ runner.os }}-pnpm- + - run: npm install -g pnpm && pnpm install - name: Import Apple Developer Certificate env: APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} @@ -143,11 +143,11 @@ jobs: save-if: "true" - uses: actions/cache@v4 with: - path: ~/.bun - key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }} + path: ~/.pnpm-store + key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | - ${{ runner.os }}-bun- - - run: curl -fsSL https://bun.sh/install | bash && bun install + ${{ runner.os }}-pnpm- + - run: npm install -g pnpm && pnpm install - uses: tauri-apps/tauri-action@v0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -199,16 +199,16 @@ jobs: save-if: "true" - uses: actions/cache@v4 with: - path: ~/.bun - key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }} + path: ~/.pnpm-store + key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | - ${{ runner.os }}-bun- + ${{ runner.os }}-pnpm- - name: Install dependencies run: | sudo apt update sudo apt install -y libwebkit2gtk-4.1-dev build-essential curl wget file libssl-dev libayatana-appindicator3-dev librsvg2-dev libasound2-dev rpm echo "PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig" >> $GITHUB_ENV - - run: curl -fsSL https://bun.sh/install | bash && bun install + - run: npm install -g pnpm && pnpm install - uses: tauri-apps/tauri-action@v0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e2ecdaa..6a11091 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -57,11 +57,11 @@ jobs: save-if: "true" - uses: actions/cache@v4 with: - path: ~/.bun - key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }} + path: ~/.pnpm-store + key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | - ${{ runner.os }}-bun- - - run: curl -fsSL https://bun.sh/install | bash && bun install + ${{ runner.os }}-pnpm- + - run: npm install -g pnpm && pnpm install - name: Import Apple Developer Certificate env: APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} @@ -83,7 +83,7 @@ jobs: TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} with: args: ${{ matrix.args }} - + - name: Rename macOS Artifacts run: | mv src-tauri/target/${{ matrix.args == '--target aarch64-apple-darwin' && 'aarch64-apple-darwin' || 'x86_64-apple-darwin' }}/release/bundle/dmg/*.dmg src-tauri/target/${{ matrix.args == '--target aarch64-apple-darwin' && 'aarch64-apple-darwin' || 'x86_64-apple-darwin' }}/release/bundle/dmg/Qopy-${{ needs.prepare.outputs.version }}_${{ matrix.arch }}.dmg @@ -125,11 +125,11 @@ jobs: save-if: "true" - uses: actions/cache@v4 with: - path: ~/.bun - key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }} + path: ~/.pnpm-store + key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | - ${{ runner.os }}-bun- - - run: curl -fsSL https://bun.sh/install | bash && bun install + ${{ runner.os }}-pnpm- + - run: npm install -g pnpm && pnpm install - uses: tauri-apps/tauri-action@v0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -189,16 +189,16 @@ jobs: save-if: "true" - uses: actions/cache@v4 with: - path: ~/.bun - key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }} + path: ~/.pnpm-store + key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | - ${{ runner.os }}-bun- + ${{ runner.os }}-pnpm- - name: Install dependencies run: | sudo apt update sudo apt install -y libwebkit2gtk-4.1-dev build-essential curl wget file libssl-dev libayatana-appindicator3-dev librsvg2-dev libasound2-dev rpm echo "PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig" >> $GITHUB_ENV - - run: curl -fsSL https://bun.sh/install | bash && bun install + - run: npm install -g pnpm && pnpm install - name: Generate Changelog id: changelog run: | @@ -293,7 +293,7 @@ jobs: ${{ needs.create-release.outputs.changelog }} ## ⬇️ Downloads - + - [Windows (x64)](https://github.com/${{ github.repository }}/releases/download/v${VERSION}/Qopy-${VERSION}_x64.msi) - ${WINDOWS_64_HASH} - [Windows (ARM64)](https://github.com/${{ github.repository }}/releases/download/v${VERSION}/Qopy-${VERSION}_arm64.msi) - ${WINDOWS_ARM_HASH} - [macOS (Silicon)](https://github.com/${{ github.repository }}/releases/download/v${VERSION}/Qopy-${VERSION}_silicon.dmg) - ${MAC_SILICON_HASH} @@ -323,4 +323,4 @@ jobs: artifacts/**/*.deb artifacts/**/*.AppImage artifacts/**/*.rpm - body: ${{ env.RELEASE_BODY }} + body: ${{ env.RELEASE_BODY }} \ No newline at end of file diff --git a/src-tauri/src/api/updater.rs b/src-tauri/src/api/updater.rs index f3d4cb0..5b153a6 100644 --- a/src-tauri/src/api/updater.rs +++ b/src-tauri/src/api/updater.rs @@ -2,7 +2,7 @@ use tauri::{ async_runtime, AppHandle }; use tauri_plugin_dialog::{ DialogExt, MessageDialogButtons, MessageDialogKind }; use tauri_plugin_updater::UpdaterExt; -pub async fn check_for_updates(app: AppHandle) { +pub async fn check_for_updates(app: AppHandle, prompted: bool) { println!("Checking for updates..."); let updater = app.updater().unwrap(); @@ -18,6 +18,10 @@ pub async fn check_for_updates(app: AppHandle) { "Would you like to install it now?", ]); + let window = app.get_webview_window("main").unwrap(); + window.show().unwrap(); + window.set_focus().unwrap(); + app.dialog() .message(msg) .title("Qopy Update Available") @@ -69,9 +73,22 @@ pub async fn check_for_updates(app: AppHandle) { }); }); } - Ok(None) => println!("No updates available."), + Ok(None) => { + println!("No updates available."); + } Err(e) => { - println!("Failed to check for updates: {:?}", e); + if prompted { + let window = app.get_webview_window("main").unwrap(); + window.show().unwrap(); + window.set_focus().unwrap(); + + app.dialog() + .message("No updates available.") + .title("Qopy Update Check") + .show(|_| {}); + } + + println!("No updates available. {}", e.to_string()); } } } diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 7f06282..0291cbc 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -99,7 +99,7 @@ fn main() { let _ = app.track_event("app_started", None); tauri::async_runtime::spawn(async move { - api::updater::check_for_updates(app_handle).await; + api::updater::check_for_updates(app_handle, false).await; }); Ok(()) diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 10ae2a2..9ce7712 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -5,8 +5,8 @@ "build": { "frontendDist": "../dist", "devUrl": "http://localhost:3000", - "beforeDevCommand": "bun nuxt dev", - "beforeBuildCommand": "bun nuxt generate" + "beforeDevCommand": "pnpm nuxt dev", + "beforeBuildCommand": "pnpm nuxt generate" }, "app": { "windows": [