Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 96e0cbfc07 | |||
| ceb8f73a2a | |||
| 1568c74cac | |||
| 21684c5fbd |
@@ -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,6 +1,5 @@
|
||||
appId: com.krunkercivilian.client
|
||||
productName: Krunker Civilian Client
|
||||
electronDist: node_modules/electron/dist
|
||||
directories:
|
||||
output: out
|
||||
buildResources: build
|
||||
|
||||
+1
-1
@@ -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",
|
||||
|
||||
@@ -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
@@ -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) => {
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user