From 2c32af6b4254422856bd84a9843a9cbe4db82f48 Mon Sep 17 00:00:00 2001 From: hzhang Date: Tue, 18 Feb 2025 21:22:47 +0000 Subject: [PATCH] improve: better version control --- Polonium.csproj | 7 ++++--- publish | 12 +++++++++++- 2 files changed, 15 insertions(+), 4 deletions(-) mode change 100644 => 100755 publish diff --git a/Polonium.csproj b/Polonium.csproj index 8de0b29..6e1222f 100644 --- a/Polonium.csproj +++ b/Polonium.csproj @@ -1,5 +1,5 @@  - + net9.0 enable @@ -8,12 +8,13 @@ false Polonium true - 0.1.1-x + $(PoloniumVersion) Hangman true - + + diff --git a/publish b/publish old mode 100644 new mode 100755 index 7ac34e4..2194240 --- a/publish +++ b/publish @@ -1,2 +1,12 @@ #!/bin/bash -dotnet nuget push "$(ls -t ./.godot/mono/temp/bin/Debug/Polonium.*.nupkg | head -n 1)" --source hangman-lab \ No newline at end of file + +SCRIPT_DIR=$(dirname "$(realpath "${BASH_SOURCE[0]}")")/ +LATEST_PACKAGE=$(ls -t "${SCRIPT_DIR}".godot/mono/temp/bin/Debug/Polonium.*.nupkg 2>/dev/null | head -n 1) + +if [[ -z "$LATEST_PACKAGE" ]]; then + echo "❌ Error: No .nupkg file found in ${SCRIPT_DIR}/bin/Debug/" + exit 1 +fi +echo "🚀 Pushing NuGet package: $LATEST_PACKAGE" +dotnet nuget push "$LATEST_PACKAGE" --source hangman-lab +