This commit is contained in:
2025-12-23 20:50:13 +06:00
parent 72f46df4d1
commit aef93ef821
4 changed files with 48 additions and 8 deletions

View File

@@ -35,4 +35,6 @@ RUN cargo install --locked cargo-xwin
RUN yarn tauri build --runner cargo-xwin --target x86_64-pc-windows-msvc
RUN node scripts/generate-updater.js
RUN ls -la

View File

@@ -0,0 +1,41 @@
import fs from 'node:fs'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const TAURI_CONF = path.resolve(__dirname, '../src-tauri/tauri.conf.json')
const OUTPUT = path.resolve(__dirname, '../updater.json')
const PLATFORM = 'windows-x86_64'
const BASE_URL = 'https://git.koptilnya.xyz/opti1337/chad/releases/download/latest'
const tauriConfRaw = fs.readFileSync(TAURI_CONF, 'utf8')
const tauriConf = JSON.parse(tauriConfRaw)
const version = tauriConf.package.version
const SIG_FILE = path.resolve(
__dirname,
`../src-tauri/target/release/bundle/nsis/chad_${version}_x64-setup.exe.sig`,
)
const signature = fs.readFileSync(SIG_FILE, 'utf8').trim()
const installerName = `chad_${version}_x64-setup.exe`
const updater = {
pub_date: new Date().toISOString(),
version,
platforms: {
[PLATFORM]: {
url: `${BASE_URL}/${installerName}`,
signature,
},
},
notes: '',
}
fs.writeFileSync(OUTPUT, JSON.stringify(updater, null, 2), 'utf8')
console.log('updater.json generated')

View File

@@ -1,7 +1,7 @@
{
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
"productName": "chad",
"version": "0.2.5-rc.2",
"version": "0.2.6",
"identifier": "xyz.koptilnya.chad",
"build": {
"frontendDist": "../.output/public",
@@ -46,7 +46,7 @@
"updater": {
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEU3MzkxMzM3RkQ3NTg4QUQKUldTdGlIWDlOeE01NStIak9VbmZTTm9HY2NyNUQrVXB5ZEdIN1BkK2lhYW9zWkNCQnZQSjRmelIK",
"endpoints": [
"https://git.koptilnya.xyz/opti1337/chad/releases/download/latest/latest.json"
"https://git.koptilnya.xyz/opti1337/chad/releases/download/latest/updater.json"
]
}
}