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
|
|
@ -22,7 +22,7 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
||||||
public override string ModuleName => "CS2-SimpleAdmin" + (Helper.IsDebugBuild ? " (DEBUG)" : " (RELEASE)");
|
public override string ModuleName => "CS2-SimpleAdmin" + (Helper.IsDebugBuild ? " (DEBUG)" : " (RELEASE)");
|
||||||
public override string ModuleDescription => "Simple admin plugin for Counter-Strike 2 :)";
|
public override string ModuleDescription => "Simple admin plugin for Counter-Strike 2 :)";
|
||||||
public override string ModuleAuthor => "daffyy";
|
public override string ModuleAuthor => "daffyy";
|
||||||
public override string ModuleVersion => "1.8.2b-zio3";
|
public override string ModuleVersion => "1.8.2b-zio4";
|
||||||
|
|
||||||
public override void Load(bool hotReload)
|
public override void Load(bool hotReload)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,11 @@ from the `build-1.8.2b` tag). Changes, all marked `zio:` in the code:
|
||||||
|
|
||||||
Publish with `FORGEJO_TOKEN=... ./release.sh v<ModuleVersion>` (ModuleVersion is `1.8.2b-zioN`).
|
Publish with `FORGEJO_TOKEN=... ./release.sh v<ModuleVersion>` (ModuleVersion is `1.8.2b-zioN`).
|
||||||
It rebuilds from the committed source and uploads `SimpleAdmin-<tag>.tar.gz` to git.zio.sh
|
It rebuilds from the committed source and uploads `SimpleAdmin-<tag>.tar.gz` to git.zio.sh
|
||||||
(`cs2/SimpleAdmin`), holding only `CS2-SimpleAdmin.dll` and `lang/en.json`. The rest of the plugin
|
(`cs2/SimpleAdmin`), laid out like `game/csgo/`. It holds the whole plugin (its libraries, all lang
|
||||||
and `shared/CS2-SimpleAdminApi` stay as the upstream 1.8.2b release installed them.
|
files and migrations) and `shared/CS2-SimpleAdminApi`, as upstream's own release does, so nothing
|
||||||
|
from upstream needs installing first. It leaves out the optional FunCommands and StealthModule
|
||||||
|
modules and `configs/`. The NickFox007 dependencies (AnyBaseLib, PlayerSettings, MenuManager) aren't
|
||||||
|
in it either; the server's `pre.sh` installs them from their own releases.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
||||||
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:
|
# 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
|
# 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
|
# The whole plugin, packaged the way upstream's CI packages its release, so nothing of upstream's
|
||||||
# files, migrations) and shared/CS2-SimpleAdminApi stay as the upstream 1.8.2b release installed
|
# has to be installed first. Not included: the optional FunCommands and StealthModule modules, and
|
||||||
# them; the fork doesn't touch the API. No configs/: those stay the server's.
|
# 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
|
set -euo pipefail
|
||||||
|
|
||||||
FORGEJO_URL="https://git.zio.sh"
|
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.
|
# 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}"
|
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:-}"
|
TAG="${1:-}"
|
||||||
if [[ -z "$TAG" ]]; then
|
if [[ -z "$TAG" ]]; then
|
||||||
echo "usage: $0 <tag> (e.g. v1.8.2b-zio1)" >&2
|
echo "usage: $0 <tag> (e.g. v1.8.2b-zio1)" >&2
|
||||||
|
|
@ -60,24 +55,24 @@ fi
|
||||||
|
|
||||||
# --- Build -----------------------------------------------------------------------
|
# --- Build -----------------------------------------------------------------------
|
||||||
OUT="release-out"
|
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"
|
STAGE="$OUT/stage"
|
||||||
PLUGIN_DIR="$STAGE/addons/counterstrikesharp/plugins/CS2-SimpleAdmin"
|
CSS_DIR="addons/counterstrikesharp"
|
||||||
mkdir -p "$PLUGIN_DIR"
|
rm -rf CS2-SimpleAdmin/bin CS2-SimpleAdmin/obj CS2-SimpleAdminApi/bin CS2-SimpleAdminApi/obj "$OUT"
|
||||||
for file in "${PLUGIN_FILES[@]}"; do
|
# dotnet build straight into the staged layout, as upstream's CI does: the csproj sets
|
||||||
mkdir -p "$PLUGIN_DIR/$(dirname "$file")"
|
# PublishTrimmed, which a plugin mustn't be. CounterStrikeSharp.API.dll is kept out by the csproj
|
||||||
cp "$PUBLISH/$file" "$PLUGIN_DIR/$file"
|
# (ExcludeAssets=runtime); the server already provides it.
|
||||||
done
|
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"
|
TARBALL="SimpleAdmin-${TAG}.tar.gz"
|
||||||
tar -czf "$OUT/$TARBALL" -C "$STAGE" addons
|
tar -czf "$OUT/$TARBALL" -C "$STAGE" addons
|
||||||
rm -rf "$STAGE" "$PUBLISH"
|
rm -rf "$STAGE"
|
||||||
|
|
||||||
echo "Packaged:"
|
echo "Packaged:"
|
||||||
tar -tzf "$OUT/$TARBALL"
|
tar -tzf "$OUT/$TARBALL"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue