From cadb3e02acf3d9f8a74d3a35dd6e29603893cf06 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.Tasks.csproj | 37 +++++++++++-------------------------- publish | 12 +++++++++++- 2 files changed, 22 insertions(+), 27 deletions(-) mode change 100644 => 100755 publish diff --git a/Polonium.Tasks.csproj b/Polonium.Tasks.csproj index 35956b3..e0b96bd 100644 --- a/Polonium.Tasks.csproj +++ b/Polonium.Tasks.csproj @@ -1,5 +1,5 @@ - + netstandard2.0 true @@ -8,7 +8,7 @@ Polonium.Tasks Polonium.Tasks true - 0.1.1-x + $(PoloniumTasksVersion) true true $(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage @@ -18,21 +18,9 @@ - - - + + + ResXFileCodeGenerator Resources.Designer.cs @@ -44,11 +32,8 @@ - + + @@ -64,10 +49,10 @@ Condition="'$(GenerateDependencyFile)' == 'true'" > - diff --git a/publish b/publish old mode 100644 new mode 100755 index 334db73..923c0c1 --- a/publish +++ b/publish @@ -1,2 +1,12 @@ #!/bin/bash -dotnet nuget push "$(ls -t ./bin/Debug/Polonium.Tasks.*.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}"bin/Debug/Polonium.Tasks.*.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 +