Compare commits
1
Commits
b97a8a73b1
...
v1.1.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
efaab8bd32 |
+30
-11
@@ -1,27 +1,46 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build a drop-in release zip for one game.
|
||||
# ./tools/build_release.sh GundamBreaker4
|
||||
# Output: dist/<Game>_UltraWide_Fix.zip (attach to the GitHub Release)
|
||||
# Build a drop-in release zip for one game. Handles both fix methods.
|
||||
# ./tools/build_release.sh GundamBreaker4 (METHOD=suwsf)
|
||||
# ./tools/build_release.sh BurglinGnomes (METHOD=bepinex)
|
||||
# Output: dist/<Game>_UltraWide_Fix.zip
|
||||
set -euo pipefail
|
||||
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
cd "$HERE"
|
||||
|
||||
GAME="${1:?usage: build_release.sh <GameName>}"
|
||||
GDIR="games/$GAME"
|
||||
V="vendor/SUWSF-x64"
|
||||
[ -d "$GDIR" ] || { echo "[!] no such game: $GDIR"; exit 1; }
|
||||
for f in "$V/SUWSF.asi" "$V/dsound.dll" "$V/LICENSE" "$GDIR/SUWSF.ini"; do
|
||||
[ -f "$f" ] || { echo "[!] missing $f"; exit 1; }
|
||||
done
|
||||
[ -f "$GDIR/game.conf" ] || { echo "[!] missing $GDIR/game.conf"; exit 1; }
|
||||
# shellcheck disable=SC1090
|
||||
. "$GDIR/game.conf"
|
||||
METHOD="${METHOD:-suwsf}"
|
||||
|
||||
OUT="dist/${GAME}_UltraWide_Fix"
|
||||
rm -rf "$OUT" "$OUT.zip"
|
||||
mkdir -p "$OUT"
|
||||
cp "$V/SUWSF.asi" "$V/dsound.dll" "$GDIR/SUWSF.ini" "$OUT/"
|
||||
cp "$V/LICENSE" "$OUT/SUWSF-LICENSE.txt"
|
||||
|
||||
if [ "$METHOD" = "bepinex" ]; then
|
||||
BEPZIP=$(ls vendor/BepInEx_win_x64_*.zip 2>/dev/null | head -1)
|
||||
[ -f "$BEPZIP" ] || { echo "[!] missing BepInEx zip in vendor/"; exit 1; }
|
||||
[ -f "$GDIR/$PLUGIN_DLL" ] || { echo "[!] missing prebuilt plugin $GDIR/$PLUGIN_DLL"; exit 1; }
|
||||
command -v unzip >/dev/null || { echo "[!] unzip required"; exit 1; }
|
||||
unzip -o -q "$BEPZIP" -d "$OUT"
|
||||
mkdir -p "$OUT/BepInEx/plugins"
|
||||
cp "$GDIR/$PLUGIN_DLL" "$OUT/BepInEx/plugins/"
|
||||
echo "[+] Packaged BepInEx + $PLUGIN_DLL"
|
||||
else
|
||||
V="vendor/SUWSF-x64"
|
||||
for f in "$V/SUWSF.asi" "$V/dsound.dll" "$V/LICENSE" "$GDIR/SUWSF.ini"; do
|
||||
[ -f "$f" ] || { echo "[!] missing $f"; exit 1; }
|
||||
done
|
||||
cp "$V/SUWSF.asi" "$V/dsound.dll" "$GDIR/SUWSF.ini" "$OUT/"
|
||||
cp "$V/LICENSE" "$OUT/SUWSF-LICENSE.txt"
|
||||
echo "[+] Packaged SUWSF + patch ini"
|
||||
fi
|
||||
|
||||
cp "$GDIR/README.md" "$OUT/README.md" 2>/dev/null || true
|
||||
cp THIRD_PARTY.md "$OUT/" 2>/dev/null || true
|
||||
cp THIRD_PARTY.md LICENSE "$OUT/" 2>/dev/null || true
|
||||
|
||||
( cd dist && zip -r -q "${GAME}_UltraWide_Fix.zip" "${GAME}_UltraWide_Fix" )
|
||||
echo "[+] Built dist/${GAME}_UltraWide_Fix.zip"
|
||||
( cd dist && sha256sum "${GAME}_UltraWide_Fix.zip" )
|
||||
unzip -l "dist/${GAME}_UltraWide_Fix.zip"
|
||||
|
||||
+12
-4
@@ -14,22 +14,30 @@ OWNER="${GITEA_OWNER:-ckoch}"
|
||||
REPO="${GITEA_REPO:-UltraWidePatches}"
|
||||
GAME="${GAME:-GundamBreaker4}"
|
||||
TAG="${TAG:-v1.0.0}"
|
||||
NOTES="${NOTES:-RELEASE_NOTES.md}"
|
||||
NOTES="${NOTES:-games/$GAME/README.md}"
|
||||
[ -f "$NOTES" ] || NOTES="RELEASE_NOTES.md"
|
||||
API="$HOST/api/v1"
|
||||
|
||||
[ -n "${GITEA_TOKEN:-}" ] || { echo "[!] GITEA_TOKEN is not set. Create one at $HOST/user/settings/applications (scope: write:repository)"; exit 1; }
|
||||
AUTH=(-H "Authorization: token $GITEA_TOKEN")
|
||||
ZIPNAME="${GAME}_UltraWide_Fix.zip"
|
||||
|
||||
# 1. build the artifact
|
||||
bash tools/build_release.sh "$GAME" >/dev/null
|
||||
# 1. build the artifact -- do NOT swallow output; a failure here used to exit
|
||||
# the whole script silently because stdout went to /dev/null under `set -e`.
|
||||
if ! bash tools/build_release.sh "$GAME"; then
|
||||
echo "[!] build_release.sh failed for game '$GAME' (see above)"; exit 1
|
||||
fi
|
||||
ZIP="dist/$ZIPNAME"
|
||||
[ -f "$ZIP" ] || { echo "[!] build produced no $ZIP"; exit 1; }
|
||||
echo "[+] Built $ZIP"
|
||||
|
||||
# 2. push code + tag
|
||||
git push origin main
|
||||
git push origin "$TAG" 2>/dev/null || echo "[i] tag $TAG already on remote"
|
||||
if ! git rev-parse -q --verify "refs/tags/$TAG" >/dev/null; then
|
||||
git tag -a "$TAG" -m "$TAG"
|
||||
echo "[+] Created tag $TAG at $(git rev-parse --short HEAD)"
|
||||
fi
|
||||
git push origin "$TAG" 2>&1 | tail -1
|
||||
|
||||
# 3. create the release (or reuse if it already exists)
|
||||
REL_ID=$(curl -sf "${AUTH[@]}" "$API/repos/$OWNER/$REPO/releases/tags/$TAG" 2>/dev/null \
|
||||
|
||||
Reference in New Issue
Block a user