Compare commits

..

4 Commits

Author SHA1 Message Date
bigjakk 96e0cbfc07 Always show Accounts button, fix Linux CI electronDist
Show Accounts menu button even with no saved accounts so users can
add accounts from the in-game menu. Remove hardcoded electronDist
from electron-builder.yml — let electron-builder auto-detect on
Linux CI, Windows CI overrides via -c.electronDist flag.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 07:46:07 -08:00
bigjakk ceb8f73a2a Fix Linux CI build — don't block stock Electron download
On non-Windows (CI), skip writing path.txt so electron-nightly still
downloads the native Linux binary into dist/. The patched Windows
binary goes to dist-win/ and is used via -c.electronDist override.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 07:30:31 -08:00
bigjakk 1568c74cac v0.5.0 — Rename save folders, bump version
Rename data folders from KCCClient to "Krunker Civilian Client" for
swapper, userscripts, and documents output. Bump version to 0.5.0.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 07:18:53 -08:00
bigjakk 21684c5fbd Update build scripts for new repo
Point electron download script to Krunker-Civilian-Client repo.
Remove mirror-releases workflow (repo is public, no KPC copy needed).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 07:12:32 -08:00
6 changed files with 11 additions and 93 deletions
-82
View File
@@ -1,82 +0,0 @@
name: Mirror Release to KCC
on:
release:
types: [published]
jobs:
mirror-release:
runs-on: ubuntu-latest
steps:
- name: Mirror release and assets
env:
BASE: https://gitea.crjlab.net/api/v1
SOURCE_REPO: bigjakk/krunker-civilian-client
DEST_REPO: bigjakk/KPC
TOKEN: ${{ secrets.DEST_GITEA_TOKEN }}
run: |
TAG="${{ github.event.release.tag_name }}"
NAME="${{ github.event.release.name }}"
BODY=$(echo '${{ toJson(github.event.release.body) }}')
# Create tag on KPC pointing to latest main commit
SHA=$(curl -s "$BASE/repos/$DEST_REPO/branches/main" \
-H "Authorization: token $TOKEN" | jq -r '.commit.id')
echo "Creating tag $TAG on KPC at $SHA"
curl -s -X POST "$BASE/repos/$DEST_REPO/tags" \
-H "Authorization: token $TOKEN" \
-H "Content-Type: application/json" \
-d "{\"tag_name\": \"$TAG\", \"message\": \"$TAG\", \"target\": \"$SHA\"}"
# Create release on KPC
RESPONSE=$(curl -s -X POST "$BASE/repos/$DEST_REPO/releases" \
-H "Authorization: token $TOKEN" \
-H "Content-Type: application/json" \
-d "{
\"tag_name\": \"$TAG\",
\"name\": \"$NAME\",
\"body\": $BODY,
\"draft\": ${{ github.event.release.draft }},
\"prerelease\": ${{ github.event.release.prerelease }}
}")
RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id')
echo "Created KPC release ID: $RELEASE_ID"
if [ "$RELEASE_ID" = "null" ] || [ -z "$RELEASE_ID" ]; then
echo "Failed to create release"
exit 1
fi
# Poll source release until assets appear (30s intervals, up to ~6 min)
echo "Waiting for source assets..."
for ATTEMPT in $(seq 1 12); do
RELEASE_INFO=$(curl -s "$BASE/repos/$SOURCE_REPO/releases/tags/$TAG" \
-H "Authorization: token $TOKEN")
ASSET_COUNT=$(echo "$RELEASE_INFO" | jq '.assets | length')
echo "Attempt $ATTEMPT/12: $ASSET_COUNT asset(s)"
[ "$ASSET_COUNT" -gt 0 ] && break
[ "$ATTEMPT" -lt 12 ] && sleep 30
done
if [ "$ASSET_COUNT" -eq 0 ]; then
echo "No assets found after 12 attempts. Aborting."
exit 1
fi
# Download and re-upload each asset to KPC
echo "$RELEASE_INFO" | jq -c '.assets[]' | while read -r asset; do
ASSET_NAME=$(echo "$asset" | jq -r '.name')
ASSET_URL=$(echo "$asset" | jq -r '.browser_download_url')
echo "Mirroring: $ASSET_NAME"
curl -sL "$ASSET_URL" -o "/tmp/$ASSET_NAME" -H "Authorization: token $TOKEN"
curl -s -X POST "$BASE/repos/$DEST_REPO/releases/$RELEASE_ID/assets?name=$ASSET_NAME" \
-H "Authorization: token $TOKEN" \
-F "attachment=@/tmp/$ASSET_NAME" | jq -r '" -> \(.name) (\(.size) bytes)"'
rm "/tmp/$ASSET_NAME"
done
-1
View File
@@ -1,6 +1,5 @@
appId: com.krunkercivilian.client
productName: Krunker Civilian Client
electronDist: node_modules/electron/dist
directories:
output: out
buildResources: build
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "krunker-civilian-client",
"version": "4.1.22",
"version": "0.5.0",
"description": "Cross-platform Krunker game client",
"main": "dist/main/index.js",
"homepage": "https://gitea.crjlab.net/bigjakk/krunker-civilian-client",
+6 -3
View File
@@ -24,7 +24,7 @@ const { execSync } = require('child_process');
const ELECTRON_VERSION = '42.0.0-nightly.20260227';
const ASSET_NAME = 'electron-v42.0.0-nightly-patched-win32-x64.zip';
const GITEA_BASE = 'https://gitea.crjlab.net';
const REPO = 'bigjakk/KPC';
const REPO = 'bigjakk/Krunker-Civilian-Client';
// The release tag that holds the patched Electron zip.
// Upload the zip as an asset to this release on Gitea.
const RELEASE_TAG = 'electron-patched';
@@ -174,8 +174,11 @@ async function main() {
// Write path.txt so the electron package's lazy downloader (index.js)
// considers the binary already installed and doesn't re-download stock.
const platformExe = process.platform === 'win32' ? 'electron.exe' : 'electron';
fs.writeFileSync(path.join(ELECTRON_DIST, '..', 'path.txt'), platformExe);
// On non-Windows (CI cross-compilation), skip this so electron-nightly still
// downloads the native Linux binary into dist/ for the Linux build target.
if (IS_WIN) {
fs.writeFileSync(path.join(ELECTRON_DIST, '..', 'path.txt'), 'electron.exe');
}
// Write marker and verify
if (fs.existsSync(VERSION_FILE)) {
+3 -3
View File
@@ -210,13 +210,13 @@ async function launchApp(): Promise<void> {
// ── Resource swapper ──
const swapperConfig = config.get('swapper');
const swapDir = swapperConfig.path || join(app.getPath('userData'), 'KCCClient', 'swapper');
const swapDir = swapperConfig.path || join(app.getPath('userData'), 'Krunker Civilian Client', 'swapper');
const swapper = swapperConfig.enabled ? new ResourceSwapper(swapDir) : null;
electronLog.log(`[KCC] Resource swapper: ${swapper ? 'enabled' : 'disabled'} (${swapDir})`);
// ── Userscript manager ──
const usConfig = config.get('userscripts') || { enabled: true, path: '' };
const usDir = usConfig.path || join(app.getPath('userData'), 'KCCClient');
const usDir = usConfig.path || join(app.getPath('userData'), 'Krunker Civilian Client');
const userscriptManager = usConfig.enabled ? new UserscriptManager(usDir) : null;
electronLog.log(`[KCC] Userscripts: ${userscriptManager ? 'enabled' : 'disabled'} (${usDir})`);
@@ -301,7 +301,7 @@ async function launchApp(): Promise<void> {
}
// ── Common output directory (used by folder actions) ──
const outputDir = join(app.getPath('documents'), 'KrunkerCivilianClient');
const outputDir = join(app.getPath('documents'), 'Krunker Civilian Client');
// ── Configurable keybinds via before-input-event ──
win.webContents.on('before-input-event', (event, input) => {
+1 -3
View File
@@ -1493,9 +1493,7 @@ ipcRenderer.on('main_did-finish-load', () => {
}
// ── In-game Accounts quick-switch button ──
if (isGamePage) {
ipcRenderer.invoke('alt-list').then((accounts: any[]) => {
if (!accounts || accounts.length === 0) return;
ipcRenderer.invoke('alt-list').then(() => {
const altBtn = document.createElement('div');
altBtn.id = 'kpcAltBtn';
altBtn.className = 'menuItem';