Compare commits

...

5 Commits

Author SHA1 Message Date
bigjakk 9a52d6b8fc chore: bump version to 0.7.8
Build and Release / build-and-release (push) Successful in 12m59s
2026-04-16 09:38:00 -07:00
bigjakk 255befd1b8 fix: use original-fs to bypass Electron asar interception 2026-04-16 09:38:00 -07:00
bigjakk 691b363f88 ci: remove sudo from workflow (Gitea runner is root)
Build and Release / build-and-release (push) Successful in 9m20s
2026-04-16 08:56:19 -07:00
bigjakk 8972c3e363 chore: bump version to 0.7.7
Build and Release / build-and-release (push) Has been cancelled
2026-04-16 08:31:27 -07:00
bigjakk 5a8d77c494 ci: auto-detect patch vs full, control asar upload accordingly
Build and Release / build-and-release (push) Successful in 8s
2026-04-16 08:26:26 -07:00
5 changed files with 44 additions and 50 deletions
+17 -26
View File
@@ -75,7 +75,7 @@ jobs:
CHANGED=$(git diff --name-only "$PREV_TAG"..HEAD)
echo "$CHANGED"
# Files that require a full (installer) build
# Files that require a full (installer-only) release
FULL_TRIGGERS="electron-builder.yml|scripts/download-electron.js"
if echo "$CHANGED" | grep -qE "^($FULL_TRIGGERS)$"; then
@@ -105,13 +105,12 @@ jobs:
with:
node-version: '22'
# Full build needs wine + system deps for electron-builder
- name: Install system dependencies
if: steps.version-check.outputs.SKIP == 'false' && steps.release-type.outputs.TYPE == 'full'
if: steps.version-check.outputs.SKIP == 'false'
run: |
sudo dpkg --add-architecture i386
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends \
dpkg --add-architecture i386
apt-get update -qq
apt-get install -y --no-install-recommends \
wine wine32 wine64 \
libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2t64 \
libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 \
@@ -123,39 +122,29 @@ jobs:
if: steps.version-check.outputs.SKIP == 'false'
run: npm ci --legacy-peer-deps
# ── Patch release: asar only ──
- name: Build asar
if: steps.version-check.outputs.SKIP == 'false' && steps.release-type.outputs.TYPE == 'patch'
run: npm run build:asar
# ── Full release: installer + asar ──
- name: Build source
if: steps.version-check.outputs.SKIP == 'false' && steps.release-type.outputs.TYPE == 'full'
if: steps.version-check.outputs.SKIP == 'false'
run: npm run build
- name: Build Windows distributables
if: steps.version-check.outputs.SKIP == 'false' && steps.release-type.outputs.TYPE == 'full'
if: steps.version-check.outputs.SKIP == 'false'
env:
WINEDEBUG: "-all"
run: npx electron-builder --win -c.electronDist=node_modules/electron/dist-win --publish never
- name: Build Linux distributables
if: steps.version-check.outputs.SKIP == 'false' && steps.release-type.outputs.TYPE == 'full'
if: steps.version-check.outputs.SKIP == 'false'
run: npx electron-builder --linux -c.electronDist=node_modules/electron/dist-linux --publish never
- name: Build asar for full release
if: steps.version-check.outputs.SKIP == 'false' && steps.release-type.outputs.TYPE == 'full'
- name: Build asar for patch updates
if: steps.version-check.outputs.SKIP == 'false' && steps.release-type.outputs.TYPE == 'patch'
run: npm run build:asar
- name: Report build sizes
if: steps.version-check.outputs.SKIP == 'false'
run: |
echo "=== Release type: ${{ steps.release-type.outputs.TYPE }} ==="
if [ "${{ steps.release-type.outputs.TYPE }}" = "full" ]; then
ls -lh out/*.exe out/*.AppImage out/*.deb 2>/dev/null || true
fi
ls -lh out/asar/* 2>/dev/null || true
- name: Generate release notes
@@ -215,7 +204,8 @@ jobs:
exit 1
fi
# Upload asar + checksums (both patch and full releases)
# Upload asar + checksums (patch releases only — signals client to use fast path)
if [ "$RELEASE_TYPE" = "patch" ]; then
for file in out/asar/app.asar out/asar/checksums.sha256; do
[ -f "$file" ] || continue
FILENAME=$(basename "$file")
@@ -226,9 +216,11 @@ jobs:
-F "attachment=@$file" \
| jq -r '" -> \(.name) (\(.size) bytes)"'
done
else
echo "Full release — skipping asar upload (forces installer update)"
fi
# Upload installer artifacts (full release only)
if [ "$RELEASE_TYPE" = "full" ]; then
# Upload installers (always — for new users and major updates)
for file in out/*.exe out/*.AppImage out/*.deb; do
[ -f "$file" ] || continue
FILENAME=$(basename "$file")
@@ -240,9 +232,8 @@ jobs:
-F "attachment=@$file" \
| jq -r '" -> \(.name) (\(.size) bytes)"'
done
fi
echo "All assets uploaded (release type: $RELEASE_TYPE)"
echo "All assets uploaded"
- name: Prune old releases
if: steps.version-check.outputs.SKIP == 'false'
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "krunker-civilian-client",
"version": "0.7.6",
"version": "0.7.8",
"description": "Cross-platform Krunker game client",
"main": "dist/main/index.js",
"homepage": "https://github.com/bigjakk/Krunker-Civilian-Client",
+6 -5
View File
@@ -1,6 +1,7 @@
import { app, BrowserWindow, Menu, clipboard, ipcMain, safeStorage, session, shell } from 'electron';
import { join, dirname } from 'path';
import { existsSync, mkdirSync, unlinkSync, promises as fsp } from 'fs';
import { existsSync, mkdirSync, promises as fsp } from 'fs';
import { existsSync as origExistsSync, unlinkSync as origUnlinkSync } from 'original-fs';
import { get as httpsGet } from 'https';
import { execFile } from 'child_process';
import * as os from 'os';
@@ -179,8 +180,8 @@ app.whenReady().then(async () => {
// Clean up stale pending asar from a previous failed swap
const resourcesDir = join(dirname(app.getPath('exe')), 'resources');
const stalePending = join(resourcesDir, 'app-pending.asar');
if (existsSync(stalePending)) {
try { unlinkSync(stalePending); } catch { /* ignore */ }
if (origExistsSync(stalePending)) {
try { origUnlinkSync(stalePending); } catch { /* ignore */ }
}
try {
@@ -213,8 +214,8 @@ app.whenReady().then(async () => {
} catch (err) {
electronLog.error('[KCC] Patch download failed:', err);
// Clean up failed download
if (existsSync(pendingPath)) {
try { unlinkSync(pendingPath); } catch { /* ignore */ }
if (origExistsSync(pendingPath)) {
try { origUnlinkSync(pendingPath); } catch { /* ignore */ }
}
if (!updateWin.isDestroyed()) updateWin.close();
}
+3 -1
View File
@@ -1,5 +1,7 @@
import { get as httpsGet } from 'https';
import { createReadStream, createWriteStream, writeFileSync, renameSync, unlinkSync, existsSync, mkdirSync } from 'fs';
// Use original-fs to bypass Electron's asar interception — required for
// writing/renaming .asar files in the resources directory.
import { createReadStream, createWriteStream, writeFileSync, renameSync, unlinkSync, existsSync, mkdirSync } from 'original-fs';
import { join, dirname } from 'path';
import { createHash } from 'crypto';
import { spawn } from 'child_process';
+1 -1
View File
@@ -20,7 +20,7 @@ export default defineConfig({
outDir: 'dist/main',
emptyDirBefore: true,
rollupOptions: {
external: ['electron', 'electron-store', ...nodeBuiltins],
external: ['electron', 'electron-store', 'original-fs', ...nodeBuiltins],
},
target: 'node20',
minify: isProd,