From 38d95b4fafd7998041e81b5237c16a9eeb11b6d8 Mon Sep 17 00:00:00 2001
From: Geometrically <18202329+Geometrically@users.noreply.github.com>
Date: Tue, 27 Aug 2024 17:50:10 -0700
Subject: [PATCH] Fix deep linking / file open on mac (#2314)
* Fix deep linking / file open on mac
* Update deep linking
* fix build
* fix build again
* update workdir
* try again
* update conf path
* try old conf
* use in house tauri
* move away from tauri GH act
* add rpm support
* Fix updater key
* Fix signing key pass
* fix ubuntu deps
* Fix macos artifacts
---
.github/workflows/app-release.yml | 46 +++++++++++++------------
apps/app/Info.plist | 56 +++----------------------------
apps/app/src/api/utils.rs | 1 +
apps/app/src/macos/deep_link.rs | 22 ++++++++++++
apps/app/src/main.rs | 30 +++++++++--------
apps/app/tauri.conf.json | 8 ++++-
6 files changed, 75 insertions(+), 88 deletions(-)
diff --git a/.github/workflows/app-release.yml b/.github/workflows/app-release.yml
index f3ffa550c..6182f9cac 100644
--- a/.github/workflows/app-release.yml
+++ b/.github/workflows/app-release.yml
@@ -78,14 +78,13 @@ jobs:
if: startsWith(matrix.platform, 'ubuntu')
run: |
sudo apt-get update
- sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
+ sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libssl-dev sqlite3
- name: Install frontend dependencies
run: pnpm install
- name: build app (macos)
- uses: tauri-apps/tauri-action@v0
- id: build_os_mac
+ run: pnpm --filter=@modrinth/app run tauri build --target universal-apple-darwin --config "tauri-release.conf.json"
if: startsWith(matrix.platform, 'macos')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -96,34 +95,37 @@ jobs:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
- TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
- TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
- with:
- args: "--target universal-apple-darwin --config ./apps/app/tauri-release.conf.json"
- tauriScript: pnpm --filter=@modrinth/app run tauri
+ TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
+ TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
- name: build app
- uses: tauri-apps/tauri-action@v0
+ run: pnpm --filter=@modrinth/app run tauri build --config "tauri-release.conf.json"
id: build_os
if: "!startsWith(matrix.platform, 'macos')"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
- TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
- with:
- tauriScript: pnpm --filter=@modrinth/app run tauri
- args: "--config ./apps/app/tauri-release.conf.json"
+ TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
+ TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
- name: upload ${{ matrix.platform }}
uses: actions/upload-artifact@v4
- if: startsWith(matrix.platform, 'macos')
with:
name: ${{ matrix.platform }}
- path: "${{ join(fromJSON(steps.build_os_mac.outputs.artifactPaths), '\n') }}"
+ path: |
+ target/*/release/bundle/*/*.dmg
+ target/*/release/bundle/*/*.app.tar.gz
+ target/*/release/bundle/*/*.app.tar.gz.sig
+ target/release/bundle/*/*.dmg
+ target/release/bundle/*/*.app.tar.gz
+ target/release/bundle/*/*.app.tar.gz.sig
+
+ target/release/bundle/*/*.AppImage
+ target/release/bundle/*/*.AppImage.tar.gz
+ target/release/bundle/*/*.AppImage.tar.gz.sig
+ target/release/bundle/*/*.deb
+ target/release/bundle/*/*.rpm
+
+ target/release/bundle/*/*.msi
+ target/release/bundle/*/*.msi.zip
+ target/release/bundle/*/*.msi.zip.sig
- - name: upload ${{ matrix.platform }}
- uses: actions/upload-artifact@v4
- if: "!startsWith(matrix.platform, 'macos')"
- with:
- name: ${{ matrix.platform }}
- path: "${{ join(fromJSON(steps.build_os.outputs.artifactPaths), '\n') }}"
diff --git a/apps/app/Info.plist b/apps/app/Info.plist
index 49ab096f4..2e875fe1f 100644
--- a/apps/app/Info.plist
+++ b/apps/app/Info.plist
@@ -6,63 +6,17 @@
CFBundleURLName
-
ModrinthApp
CFBundleURLSchemes
-
modrinth
+ modrinthscheme
-
- CFBundleDocumentTypes
-
-
- CFBundleTypeName
- Modrinth type
- CFBundleTypeRole
- Editor
- LSHandlerRank
- Owner
- LSItemContentTypes
-
- com.modrinth.theseus-type
-
- NSDocumentClass
- NSDocument
-
-
- UTImportedTypeDeclarations
-
-
- UTTypeConformsTo
-
- public.data
-
- UTTypeDescription
- Modrinth File
- UTTypeIcons
-
- UTTypeIdentifier
- com.modrinth.theseus-type
- UTTypeTagSpecification
-
- public.filename-extension
-
- mrpack
-
- public.mime-type
-
- application/x-mrpack
-
-
-
-
- NSCameraUsageDescription
- A Minecraft mod wants to access your camera.
- NSMicrophoneUsageDescription
- A Minecraft mod wants to access your microphone.
-
+ NSCameraUsageDescription
+ A Minecraft mod wants to access your camera.
+ NSMicrophoneUsageDescription
+ A Minecraft mod wants to access your microphone.
diff --git a/apps/app/src/api/utils.rs b/apps/app/src/api/utils.rs
index 831e90d41..391ea50f4 100644
--- a/apps/app/src/api/utils.rs
+++ b/apps/app/src/api/utils.rs
@@ -137,5 +137,6 @@ pub async fn get_opening_command() -> Result