Merge branch 'main' into issue/settings

This commit is contained in:
PandaDEV 2025-01-10 22:20:44 +10:00 committed by GitHub
commit dde27b37a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 50 additions and 33 deletions

View file

@ -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 }}

View file

@ -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 }}

View file

@ -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());
}
}
}

View file

@ -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(())

View file

@ -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": [