Skip to content

Commit 0998476

Browse files
committed
finished launcher basic functionality
1 parent 170d575 commit 0998476

File tree

15 files changed

+1919
-1686
lines changed

15 files changed

+1919
-1686
lines changed

.github/workflow/release.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: "publish"
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- release
8+
9+
jobs:
10+
publish-tauri:
11+
permissions:
12+
contents: write
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
include:
17+
- platform: "windows-latest"
18+
args: ""
19+
20+
runs-on: ${{ matrix.platform }}
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: setup node
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: lts/*
28+
cache: "pnpm"
29+
30+
- name: install Rust stable
31+
uses: dtolnay/rust-toolchain@stable
32+
with:
33+
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
34+
35+
- name: Rust cache
36+
uses: swatinem/rust-cache@v2
37+
with:
38+
workspaces: "./src-tauri -> target"
39+
40+
- name: install frontend dependencies
41+
run: pnpm install
42+
43+
- uses: tauri-apps/tauri-action@v0
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
with:
47+
tagName: app-v__VERSION__
48+
releaseName: "App v__VERSION__"
49+
releaseBody: "See the assets to download this version and install."
50+
releaseDraft: true
51+
prerelease: false
52+
args: ${{ matrix.args }}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"@tauri-apps/plugin-http": "~2.5.0",
2525
"@tauri-apps/plugin-opener": "~2.4.0",
2626
"@tauri-apps/plugin-store": "~2.3.0",
27+
"@tauri-apps/plugin-updater": "~2.9.0",
2728
"markdown-it": "^14.1.0",
2829
"markdown-it-emoji": "^3.0.0",
2930
"tailwindcss": "^4.1.11"

pnpm-lock.yaml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.lock

Lines changed: 99 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,6 @@ tauri-plugin-dialog = "2"
2929
tauri-plugin-fs = "2"
3030
tauri-plugin-http = "2"
3131

32+
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
33+
tauri-plugin-updater = "2"
34+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"identifier": "desktop-capability",
3+
"platforms": [
4+
"macOS",
5+
"windows",
6+
"linux"
7+
],
8+
"windows": [
9+
"main"
10+
],
11+
"permissions": [
12+
"updater:default"
13+
]
14+
}

src-tauri/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ fn ensure_wasplib_at_tag(path: PathBuf, tag: &str) -> Result<(), Error> {
115115
};
116116

117117
let target_commit_id = {
118+
repo.find_remote("origin")?.fetch(
119+
&[&format!("refs/tags/{}:refs/tags/{}", tag, tag)],
120+
None,
121+
None,
122+
)?;
118123
let tag_ref = repo.find_reference(&format!("refs/tags/{}", tag))?;
119124
let target_obj = tag_ref.peel(ObjectType::Commit)?;
120125
target_obj.id()
@@ -433,6 +438,7 @@ fn handle_client(mut stream: TcpStream, app: tauri::AppHandle) -> bool {
433438
#[cfg_attr(mobile, tauri::mobile_entry_point)]
434439
pub fn run() {
435440
tauri::Builder::default()
441+
.plugin(tauri_plugin_updater::Builder::new().build())
436442
.plugin(tauri_plugin_fs::init())
437443
.plugin(tauri_plugin_dialog::init())
438444
.plugin(tauri_plugin_store::Builder::new().build())

src-tauri/tauri.conf.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,23 @@
2424
}
2525
},
2626
"bundle": {
27+
"createUpdaterArtifacts": true,
2728
"active": true,
28-
"targets": "all",
29+
"targets": "msi",
2930
"icon": [
3031
"icons/32x32.png",
3132
"icons/128x128.png",
3233
"icons/128x128@2x.png",
3334
"icons/icon.icns",
3435
"icons/icon.ico"
3536
]
37+
},
38+
"plugins": {
39+
"updater": {
40+
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDY4ODFBNEVGRDk3NzFEODgKUldTSUhYZlo3NlNCYUV3TXpiRnJ5c1pVWFIrOFkvSncwQjdSUlNWT0pCNzdBY2J3aEQ4VEZub2sK",
41+
"endpoints": [
42+
"https://github.com/WaspScripts/wasp-launcher/releases/latest/download/latest.json"
43+
]
44+
}
3645
}
3746
}

src/error.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>%sveltekit.error.message%</title>
6+
</head>
7+
<body>
8+
<h1>Error!</h1>
9+
<p>Status: %sveltekit.status%</p>
10+
<p>Message: %sveltekit.error.message%</p>
11+
</body>
12+
</html>

0 commit comments

Comments
 (0)