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>
This commit is contained in:
@@ -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
|
|
||||||
@@ -24,7 +24,7 @@ const { execSync } = require('child_process');
|
|||||||
const ELECTRON_VERSION = '42.0.0-nightly.20260227';
|
const ELECTRON_VERSION = '42.0.0-nightly.20260227';
|
||||||
const ASSET_NAME = 'electron-v42.0.0-nightly-patched-win32-x64.zip';
|
const ASSET_NAME = 'electron-v42.0.0-nightly-patched-win32-x64.zip';
|
||||||
const GITEA_BASE = 'https://gitea.crjlab.net';
|
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.
|
// The release tag that holds the patched Electron zip.
|
||||||
// Upload the zip as an asset to this release on Gitea.
|
// Upload the zip as an asset to this release on Gitea.
|
||||||
const RELEASE_TAG = 'electron-patched';
|
const RELEASE_TAG = 'electron-patched';
|
||||||
|
|||||||
Reference in New Issue
Block a user