Initial commit — Krunker Civilian Client
Cross-platform Krunker.io game client forked from Krunker Police Client with all KPD/moderator features stripped: no KPD auth, OBS recording, evidence uploads, yt-dlp, bytenode, or code obfuscation. Retained: unlimited FPS (custom Electron 42), ad blocking, resource swapper, matchmaker, userscripts, chat translator, Discord RPC, alt account manager, configurable keybinds, and advanced Chromium flags. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,138 @@
|
||||
name: Build and Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build-and-release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Check if version already released
|
||||
id: version-check
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.DEST_GITEA_TOKEN }}
|
||||
run: |
|
||||
VERSION=$(grep '"version"' package.json | head -1 | sed 's/.*"version": *"\([^"]*\)".*/\1/')
|
||||
TAG="v$VERSION"
|
||||
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
|
||||
echo "TAG=$TAG" >> "$GITHUB_OUTPUT"
|
||||
|
||||
STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
|
||||
"https://gitea.crjlab.net/api/v1/repos/bigjakk/krunker-civilian-client/releases/tags/$TAG" \
|
||||
-H "Authorization: token $GITEA_TOKEN")
|
||||
|
||||
if [ "$STATUS" = "200" ]; then
|
||||
echo "Release $TAG already exists, skipping build"
|
||||
echo "SKIP=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "No release for $TAG, proceeding with build"
|
||||
echo "SKIP=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Setup Node.js
|
||||
if: steps.version-check.outputs.SKIP == 'false'
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '22'
|
||||
|
||||
- name: Install system dependencies
|
||||
if: steps.version-check.outputs.SKIP == 'false'
|
||||
run: |
|
||||
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 \
|
||||
libxfixes3 libxrandr2 libgbm1 libpango-1.0-0 \
|
||||
libcairo2 libasound2t64 libgtk-3-0
|
||||
WINEDEBUG=-all wine wineboot --init || true
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.version-check.outputs.SKIP == 'false'
|
||||
run: npm ci
|
||||
|
||||
- name: Build source
|
||||
if: steps.version-check.outputs.SKIP == 'false'
|
||||
run: npm run build
|
||||
|
||||
- name: Build Windows distributables
|
||||
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'
|
||||
run: npx electron-builder --linux --publish never
|
||||
|
||||
- name: Report build sizes
|
||||
if: steps.version-check.outputs.SKIP == 'false'
|
||||
run: |
|
||||
echo "=== Build output sizes ==="
|
||||
ls -lh out/*.exe out/*.AppImage out/*.deb 2>/dev/null || true
|
||||
echo "=== Electron dist-win (patched Windows) ==="
|
||||
du -sh node_modules/electron/dist-win/ 2>/dev/null || true
|
||||
echo "=== Electron dist (stock Linux) ==="
|
||||
du -sh node_modules/electron/dist/ 2>/dev/null || true
|
||||
echo "=== Unpacked Windows build ==="
|
||||
du -sh out/win-unpacked/ 2>/dev/null || true
|
||||
du -sh out/win-unpacked/resources/ 2>/dev/null || true
|
||||
du -sh out/win-unpacked/locales/ 2>/dev/null || true
|
||||
|
||||
- name: Create release and upload assets
|
||||
if: steps.version-check.outputs.SKIP == 'false'
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.DEST_GITEA_TOKEN }}
|
||||
TAG: ${{ steps.version-check.outputs.TAG }}
|
||||
run: |
|
||||
GITEA_BASE="https://gitea.crjlab.net"
|
||||
REPO="bigjakk/krunker-civilian-client"
|
||||
|
||||
# Create tag
|
||||
curl -s -X POST "$GITEA_BASE/api/v1/repos/$REPO/tags" \
|
||||
-H "Authorization: token $GITEA_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"tag_name\": \"$TAG\", \"message\": \"$TAG\", \"target\": \"$GITHUB_SHA\"}"
|
||||
|
||||
# Create release
|
||||
RESPONSE=$(curl -s -X POST "$GITEA_BASE/api/v1/repos/$REPO/releases" \
|
||||
-H "Authorization: token $GITEA_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{
|
||||
\"tag_name\": \"$TAG\",
|
||||
\"name\": \"$TAG\",
|
||||
\"body\": \"Automated build for $TAG\",
|
||||
\"draft\": false,
|
||||
\"prerelease\": false
|
||||
}")
|
||||
|
||||
RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id')
|
||||
echo "Created release ID: $RELEASE_ID"
|
||||
|
||||
if [ "$RELEASE_ID" = "null" ] || [ -z "$RELEASE_ID" ]; then
|
||||
echo "Failed to create release:"
|
||||
echo "$RESPONSE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Upload all built artifacts
|
||||
for file in out/*.exe out/*.AppImage out/*.deb; do
|
||||
[ -f "$file" ] || continue
|
||||
FILENAME=$(basename "$file")
|
||||
SAFE_NAME=$(echo "$FILENAME" | tr ' ' '_')
|
||||
echo "Uploading: $SAFE_NAME ($(du -h "$file" | cut -f1))"
|
||||
|
||||
curl -s -X POST \
|
||||
"$GITEA_BASE/api/v1/repos/$REPO/releases/$RELEASE_ID/assets?name=$SAFE_NAME" \
|
||||
-H "Authorization: token $GITEA_TOKEN" \
|
||||
-F "attachment=@$file" \
|
||||
| jq -r '" -> \(.name) (\(.size) bytes)"'
|
||||
done
|
||||
|
||||
echo "All assets uploaded"
|
||||
@@ -0,0 +1,82 @@
|
||||
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
|
||||
Reference in New Issue
Block a user