zio fork 1.8.2b-zio4: release the whole plugin and shared API, not just the changed files
This commit is contained in:
parent
2069c1a690
commit
bc6e32892d
3 changed files with 26 additions and 28 deletions
45
release.sh
45
release.sh
|
|
@ -10,11 +10,13 @@
|
|||
# Asset: SimpleAdmin-<tag>.tar.gz, laid out like the server's game/csgo/ - extract it there:
|
||||
# tar -xzf SimpleAdmin-<tag>.tar.gz -C /srv/cs2/game/csgo
|
||||
#
|
||||
# addons/counterstrikesharp/plugins/CS2-SimpleAdmin/ CS2-SimpleAdmin.dll, lang/en.json
|
||||
# addons/counterstrikesharp/plugins/CS2-SimpleAdmin/ the plugin, its libraries, lang/, migrations
|
||||
# addons/counterstrikesharp/shared/CS2-SimpleAdminApi/ the shared API (unchanged from upstream)
|
||||
#
|
||||
# Only the files the fork changes. Everything else in the plugin folder (its libraries, other lang
|
||||
# files, migrations) and shared/CS2-SimpleAdminApi stay as the upstream 1.8.2b release installed
|
||||
# them; the fork doesn't touch the API. No configs/: those stay the server's.
|
||||
# The whole plugin, packaged the way upstream's CI packages its release, so nothing of upstream's
|
||||
# has to be installed first. Not included: the optional FunCommands and StealthModule modules, and
|
||||
# the NickFox007 dependencies (AnyBaseLib, PlayerSettings, MenuManager), which pre.sh installs from
|
||||
# their own releases. No configs/: the database settings stay the server's.
|
||||
set -euo pipefail
|
||||
|
||||
FORGEJO_URL="https://git.zio.sh"
|
||||
|
|
@ -24,13 +26,6 @@ REPO="SimpleAdmin"
|
|||
# Only uploading needs it; downloading from the public repo doesn't. Don't commit a real token.
|
||||
FORGEJO_TOKEN="${FORGEJO_TOKEN:-CHANGE_ME_FORGEJO_TOKEN}"
|
||||
|
||||
# Only these ship from the publish output. CounterStrikeSharp.API.dll is excluded by the csproj
|
||||
# (ExcludeAssets=runtime); the server already provides it.
|
||||
PLUGIN_FILES=(
|
||||
CS2-SimpleAdmin.dll
|
||||
lang/en.json
|
||||
)
|
||||
|
||||
TAG="${1:-}"
|
||||
if [[ -z "$TAG" ]]; then
|
||||
echo "usage: $0 <tag> (e.g. v1.8.2b-zio1)" >&2
|
||||
|
|
@ -60,24 +55,24 @@ fi
|
|||
|
||||
# --- Build -----------------------------------------------------------------------
|
||||
OUT="release-out"
|
||||
PUBLISH="$OUT/publish"
|
||||
rm -rf CS2-SimpleAdmin/bin CS2-SimpleAdmin/obj CS2-SimpleAdminApi/bin CS2-SimpleAdminApi/obj "$OUT"
|
||||
# dotnet build, as upstream's CI does: the csproj sets PublishTrimmed, which a plugin mustn't be.
|
||||
podman run --rm -v "$(pwd)":/src:Z -w /src \
|
||||
mcr.microsoft.com/dotnet/sdk:10.0 dotnet build CS2-SimpleAdmin/CS2-SimpleAdmin.csproj -c Release -o "/src/$PUBLISH"
|
||||
|
||||
# --- Stage (layout of game/csgo/) and package ----------------------------------------
|
||||
STAGE="$OUT/stage"
|
||||
PLUGIN_DIR="$STAGE/addons/counterstrikesharp/plugins/CS2-SimpleAdmin"
|
||||
mkdir -p "$PLUGIN_DIR"
|
||||
for file in "${PLUGIN_FILES[@]}"; do
|
||||
mkdir -p "$PLUGIN_DIR/$(dirname "$file")"
|
||||
cp "$PUBLISH/$file" "$PLUGIN_DIR/$file"
|
||||
done
|
||||
CSS_DIR="addons/counterstrikesharp"
|
||||
rm -rf CS2-SimpleAdmin/bin CS2-SimpleAdmin/obj CS2-SimpleAdminApi/bin CS2-SimpleAdminApi/obj "$OUT"
|
||||
# dotnet build straight into the staged layout, as upstream's CI does: the csproj sets
|
||||
# PublishTrimmed, which a plugin mustn't be. CounterStrikeSharp.API.dll is kept out by the csproj
|
||||
# (ExcludeAssets=runtime); the server already provides it.
|
||||
podman run --rm -v "$(pwd)":/src:Z -w /src mcr.microsoft.com/dotnet/sdk:10.0 sh -c "
|
||||
dotnet build CS2-SimpleAdmin/CS2-SimpleAdmin.csproj -c Release -o '/src/$STAGE/$CSS_DIR/plugins/CS2-SimpleAdmin' &&
|
||||
dotnet build CS2-SimpleAdminApi/CS2-SimpleAdminApi.csproj -c Release -o '/src/$STAGE/$CSS_DIR/shared/CS2-SimpleAdminApi'"
|
||||
if find "$STAGE" -name CounterStrikeSharp.API.dll | grep -q .; then
|
||||
echo "CounterStrikeSharp.API.dll ended up in the build output; not packaging it." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# --- Package (layout of game/csgo/) ------------------------------------------------
|
||||
TARBALL="SimpleAdmin-${TAG}.tar.gz"
|
||||
tar -czf "$OUT/$TARBALL" -C "$STAGE" addons
|
||||
rm -rf "$STAGE" "$PUBLISH"
|
||||
rm -rf "$STAGE"
|
||||
|
||||
echo "Packaged:"
|
||||
tar -tzf "$OUT/$TARBALL"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue