Skip to content

Commit f9c44fd

Browse files
committed
Show play stats on game cards
1 parent 7adaae0 commit f9c44fd

27 files changed

Lines changed: 1211 additions & 262 deletions

.github/workflows/release.yaml

Lines changed: 137 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -3,101 +3,172 @@ name: Release Workflow
33
on:
44
push:
55
tags:
6-
- '*.*.*'
6+
- "[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]"
7+
8+
permissions:
9+
contents: write
10+
11+
env:
12+
DEMO_URL: https://nnnsmm.github.io/Launcherg-Mod/
13+
RELEASE_URL: https://github.com/nnnSMM/Launcherg-Mod/releases
714

815
jobs:
916
release:
1017
runs-on: windows-latest
1118

1219
steps:
1320
- name: Checkout code
14-
uses: actions/checkout@v2
21+
uses: actions/checkout@v4
1522

16-
- name: Extract tag name
23+
- name: Extract release versions
1724
id: variables
18-
run: echo "version=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
19-
shell: bash
25+
shell: pwsh
26+
run: |
27+
$tagName = "${env:GITHUB_REF_NAME}" -replace '^v', ''
28+
if ($tagName -match '^\d{8}$') {
29+
$year = [int]$tagName.Substring(2, 2)
30+
$month = [int]$tagName.Substring(4, 2)
31+
$day = [int]$tagName.Substring(6, 2)
32+
$appVersion = "${year}.${month}.${day}"
33+
$displayVersion = $tagName
34+
} else {
35+
throw "Unsupported release tag '${tagName}'. Use YYYYMMDD, for example 20260524."
36+
}
37+
"tag_name=${tagName}" >> $env:GITHUB_OUTPUT
38+
"app_version=${appVersion}" >> $env:GITHUB_OUTPUT
39+
"display_version=${displayVersion}" >> $env:GITHUB_OUTPUT
40+
41+
- name: Setup Node
42+
uses: actions/setup-node@v4
43+
with:
44+
node-version: 24
45+
cache: npm
46+
47+
- name: Install dependencies
48+
run: npm ci
49+
50+
- name: Check frontend
51+
run: npm run check
52+
53+
- name: Build demo before release
54+
run: npm run build-demo
55+
56+
- name: Verify demo build output
57+
shell: pwsh
58+
run: |
59+
if (!(Test-Path "docs/demo/index.html")) {
60+
throw "docs/demo/index.html was not generated."
61+
}
62+
63+
- name: Check published demo URL
64+
shell: pwsh
65+
run: |
66+
try {
67+
$response = Invoke-WebRequest -Uri "${{ env.DEMO_URL }}" -Method Head -UseBasicParsing -TimeoutSec 20
68+
if ($response.StatusCode -lt 200 -or $response.StatusCode -ge 400) {
69+
throw "Unexpected status code: $($response.StatusCode)"
70+
}
71+
} catch {
72+
Write-Warning "Published demo URL could not be verified. The local demo build succeeded, so release can continue. $($_.Exception.Message)"
73+
}
2074
21-
- name: Update package.version in tauri.conf.json
75+
- name: Update app version in tauri.conf.json
76+
shell: pwsh
2277
run: |
2378
$json = Get-Content -Path "src-tauri\tauri.conf.json" -Raw | ConvertFrom-Json
24-
$json.package.version = "${{ steps.variables.outputs.version }}"
79+
$json.version = "${{ steps.variables.outputs.app_version }}"
2580
$json | ConvertTo-Json -Depth 100 | Set-Content -Path "src-tauri\tauri.conf.json"
2681
27-
- uses: actions/cache@v3
82+
- uses: actions/cache@v4
2883
with:
2984
path: |
3085
~/.cargo/bin/
3186
~/.cargo/registry/index/
3287
~/.cargo/registry/cache/
3388
~/.cargo/git/db/
34-
target/
89+
src-tauri/target/
3590
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
3691

37-
- uses: actions/setup-node@v3
38-
39-
- name: Install dependencies and build
92+
- name: Build Tauri app
4093
env:
4194
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
4295
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
43-
run: |
44-
npm i
45-
npm run tauri build
46-
47-
- uses: ncipollo/release-action@v1
48-
with:
49-
artifacts: .\src-tauri\target\release\bundle\msi\Launcherg_${{ steps.variables.outputs.version }}_x64_ja-JP.msi.zip
50-
token: ${{ secrets.GITHUB_TOKEN }}
51-
prerelease: true
96+
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY || secrets.TAURI_PRIVATE_KEY }}
97+
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD || secrets.TAURI_KEY_PASSWORD }}
98+
run: npm run tauri build
5299

53-
- name: Update .tauri-updater.json
100+
- name: Generate updater and UI metadata
101+
shell: pwsh
54102
run: |
55-
$env:TEMP_SIGNATURE = Get-Content -Path ".\src-tauri\target\release\bundle\msi\Launcherg_${{ steps.variables.outputs.version }}_x64_ja-JP.msi.zip.sig"
56-
$data = @{
57-
version = "${{ steps.variables.outputs.version }}"
58-
notes = "See the assets to download this version and install."
59-
pub_date = (Get-Date -Format s) + "Z"
60-
signature = $env:TEMP_SIGNATURE
61-
url = "https://github.com/ryoha000/launcherg/releases/download/${{ steps.variables.outputs.version }}/Launcherg_${{ steps.variables.outputs.version }}_x64_ja-JP.msi.zip"
103+
$tagName = "${{ steps.variables.outputs.tag_name }}"
104+
$appVersion = "${{ steps.variables.outputs.app_version }}"
105+
$displayVersion = "${{ steps.variables.outputs.display_version }}"
106+
$builtArtifactName = "Launcherg_${appVersion}_x64_ja-JP.msi.zip"
107+
$releaseArtifactName = "Launcherg_${displayVersion}_x64_ja-JP.msi.zip"
108+
$builtArtifactPath = ".\src-tauri\target\release\bundle\msi\${builtArtifactName}"
109+
$builtSignaturePath = "${builtArtifactPath}.sig"
110+
$releaseArtifactPath = ".\src-tauri\target\release\bundle\msi\${releaseArtifactName}"
111+
$releaseSignaturePath = "${releaseArtifactPath}.sig"
112+
if (!(Test-Path $builtArtifactPath)) {
113+
throw "Updater artifact was not found: ${builtArtifactPath}"
114+
}
115+
if (!(Test-Path $builtSignaturePath)) {
116+
throw "Updater signature was not found: ${builtSignaturePath}"
117+
}
118+
if ($builtArtifactPath -ne $releaseArtifactPath) {
119+
Copy-Item -Path $builtArtifactPath -Destination $releaseArtifactPath -Force
120+
Copy-Item -Path $builtSignaturePath -Destination $releaseSignaturePath -Force
62121
}
63-
$data | ConvertTo-Json | Set-Content -Path ".tauri-updater.json"
64-
- name: format files
65-
run: npx -y prettier .\src-tauri\tauri.conf.json .\.tauri-updater.json --write
66122
67-
- name: Archive production artifacts
68-
uses: actions/upload-artifact@v3
69-
with:
70-
name: changed-files
71-
path: |
72-
src-tauri/tauri.conf.json
73-
.tauri-updater.json
123+
$pubDate = (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")
124+
$downloadUrl = "${{ env.RELEASE_URL }}/download/${tagName}/${releaseArtifactName}"
125+
$signature = (Get-Content -Path $releaseSignaturePath -Raw).Trim()
126+
$notes = "See the release notes and demo before updating."
74127
75-
push-changed-files:
76-
runs-on: ubuntu-latest
77-
needs: release
78-
steps:
79-
- name: Checkout code
80-
uses: actions/checkout@v2
81-
with:
82-
ref: main
83-
84-
- name: Download artifacts
85-
uses: actions/download-artifact@v3
86-
with:
87-
name: changed-files
88-
path: changed-files
89-
90-
- name: Move files to correct locations
91-
run: |
92-
mv changed-files/src-tauri/tauri.conf.json src-tauri/tauri.conf.json
93-
mv changed-files/.tauri-updater.json .tauri-updater.json
128+
$updaterData = @{
129+
version = $appVersion
130+
notes = $notes
131+
pub_date = $pubDate
132+
signature = $signature
133+
url = $downloadUrl
134+
}
135+
$updaterData | ConvertTo-Json -Depth 10 | Set-Content -Path ".tauri-updater.json"
94136
95-
- name: Push updated files to main
137+
$uiInfo = @{
138+
version = $appVersion
139+
displayVersion = $displayVersion
140+
pubDate = $pubDate
141+
demoUrl = "${{ env.DEMO_URL }}"
142+
releaseUrl = "${{ env.RELEASE_URL }}/tag/${tagName}"
143+
highlights = @()
144+
}
145+
$uiInfo | ConvertTo-Json -Depth 10 | Set-Content -Path "update-info.json"
146+
147+
- name: Verify updater manifest
148+
shell: pwsh
96149
run: |
97-
git config --local user.email "action@github.com"
98-
git config --local user.name "GitHub Action"
99-
git add src-tauri/tauri.conf.json
100-
git add .tauri-updater.json
101-
git commit -m "Update for release ${{ steps.variables.outputs.version }}"
102-
git push origin main
103-
shell: bash
150+
$tagName = "${{ steps.variables.outputs.tag_name }}"
151+
$appVersion = "${{ steps.variables.outputs.app_version }}"
152+
$displayVersion = "${{ steps.variables.outputs.display_version }}"
153+
$expectedUrl = "${{ env.RELEASE_URL }}/download/${tagName}/Launcherg_${displayVersion}_x64_ja-JP.msi.zip"
154+
$data = Get-Content -Path ".tauri-updater.json" -Raw | ConvertFrom-Json
155+
if ($data.version -ne $appVersion) {
156+
throw "Unexpected updater version: $($data.version)"
157+
}
158+
if ($data.url -ne $expectedUrl) {
159+
throw "Unexpected updater URL: $($data.url)"
160+
}
161+
if ([string]::IsNullOrWhiteSpace($data.signature)) {
162+
throw "Updater signature is empty."
163+
}
164+
Write-Host "Updater manifest verified: version=$($data.version), url=$($data.url)"
165+
166+
- name: Format generated metadata
167+
run: npx -y prettier .\src-tauri\tauri.conf.json .\.tauri-updater.json .\update-info.json --write
168+
169+
- name: Create GitHub release
170+
uses: ncipollo/release-action@v1
171+
with:
172+
artifacts: ".\\src-tauri\\target\\release\\bundle\\msi\\Launcherg_${{ steps.variables.outputs.display_version }}_x64_ja-JP.msi.zip,.\\src-tauri\\target\\release\\bundle\\msi\\Launcherg_${{ steps.variables.outputs.display_version }}_x64_ja-JP.msi.zip.sig,.\\.tauri-updater.json,.\\update-info.json"
173+
token: ${{ secrets.GITHUB_TOKEN }}
174+
prerelease: true

.tauri-updater.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"pub_date": "2024-03-16T16:52:07Z",
33
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSRHRFSWpKWGJTaDVOVFdPekFvU0tBUXh6NmFIM3gya1cwWkcrMHBLekVpbktZcXdFa3hyMGNZQUtWS0Q0cVlPOXN2UXluSDU5TWR5akpKcDRoMnJEZms5R25BZjY5V3dZPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzEwNjA3OTI0CWZpbGU6TGF1bmNoZXJnXzAuMy4zX3g2NF9qYS1KUC5tc2kuemlwCm92b2Z3S21STnJDTklrOXVmL0hvR2NWbEVaQ3pJcGNreXIzNitWQzdFQ0ZXMWxyNWx4WFVDZzFQQU0rWHozUGhXZ29XM1dpbnVuQlZWQThiU0o3R0FBPT0K",
4-
"url": "https://github.com/ryoha000/launcherg/releases/download/0.3.3/Launcherg_0.3.3_x64_ja-JP.msi.zip",
4+
"url": "https://github.com/nnnSMM/Launcherg-Mod/releases/download/0.3.3/Launcherg_0.3.3_x64_ja-JP.msi.zip",
55
"notes": "See the assets to download this version and install.",
66
"version": "0.3.3"
77
}

USAGE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
公開ページ: https://nnnsmm.github.io/Launcherg-Mod/
44

55
Launcherg は、**「エロゲー批評空間」に登録されているノベルゲーム専用**のランチャーアプリケーションです。
6-
このアプリは ryoha000 さんのオリジナルリポジトリ [Launcherg](https://github.com/ryoha000/launcherg) をクローンし、独自に改造したものです。
6+
このアプリは ryoha000 さんのオリジナル版 Launcherg をクローンし、独自に改造したものです。
77
散らばりがちなゲームを一元管理し、プレイ時間を自動的に記録することができます。
88

99
> [!IMPORTANT]

docs/skill-graph/domains/decision-log.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ id: decision-log
33
title: Decision Log
44
type: log
55
status: active
6-
updated: 2026-05-21
6+
updated: 2026-05-24
77
links:
88
- launcherg-improvement-moc
99
- template-decision-record
@@ -12,6 +12,14 @@ links:
1212

1313
# Decision Log
1414

15+
## 2026-05-24: アプリ内更新通知は手動実行と demo 確認を前提にする
16+
17+
- Context: 新しい Release を公開した時にアプリ内で知らせたいが、ユーザーの明示操作なしにダウンロード、インストール、再起動が走ると既存作業やゲーム管理を妨げる。
18+
- Decision: 起動時は Tauri updater の `check()` のみを実行し、更新がある場合だけタイトルバーに小さな通知を出す。`downloadAndInstall()``relaunch()` は UpdateDialog の「アップデート」押下後だけ呼ぶ。更新前の確認先として GitHub Pages demo と GitHub Release を分けて開く。
19+
- Rationale: Launcherg-Mod はローカルデータとプレイ中の状態を扱うため、更新処理はユーザーがタイミングを選べる必要がある。demo で先に見た目や機能を試せる導線を置くことで、更新判断の材料を増やせる。
20+
- Consequence: updater 用 `.tauri-updater.json` と UI 用 `update-info.json` は release workflow で分けて生成する。Mod版のReleaseタグは `YYYYMMDD` だけを使い、Tauri updater と Windows MSI の制約に合わせて内部バージョンだけ `YY.M.D` に変換する。demo/dev mock では更新通知 UI だけを確認し、実インストールは行わない。
21+
- Links: [[product-context]], [[architecture-map]], [[quality-gates]]
22+
1523
## 2026-05-21: 初プレイ日時は実プレイ時間の初回記録時に保存する
1624

1725
- Context: ヒートマップやプレイ履歴の振り返りで、登録日やインストール日とは別に「初めて遊んだ日」が必要になった。

package-lock.json

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

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
"@tauri-apps/plugin-fs": "^2.0.0-rc.1",
2525
"@tauri-apps/plugin-global-shortcut": "^2.3.0",
2626
"@tauri-apps/plugin-http": "^2.0.0-rc.1",
27+
"@tauri-apps/plugin-process": "2.3.1",
2728
"@tauri-apps/plugin-shell": "^2.0.0-rc.0",
29+
"@tauri-apps/plugin-updater": "2.8.1",
2830
"@unocss/reset": "^0.52.5",
2931
"easymde": "^2.18.0",
3032
"embla-carousel-svelte": "^8.6.0",

0 commit comments

Comments
 (0)