From 5904ee052445d11213a025c0fd6a9165faac9bbc Mon Sep 17 00:00:00 2001 From: Meerow Date: Mon, 16 Dec 2024 14:56:35 +0100 Subject: [PATCH] ci: fix only getting the second last tag --- .github/workflows/ci-cd.yml | 2 +- Build/Program.cs | 25 +++++++++++++++++-------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 421fdf9..ca48a5e 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -65,7 +65,7 @@ jobs: - name: Get Current Tag shell: bash run: | - CURRENT_TAG=$(git describe --tags --abbrev=0) + CURRENT_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) echo "CURRENT_TAG=$CURRENT_TAG" >> $GITHUB_ENV - name: Debug Current Tag diff --git a/Build/Program.cs b/Build/Program.cs index 61006e0..e4b68fb 100644 --- a/Build/Program.cs +++ b/Build/Program.cs @@ -205,14 +205,23 @@ public override void Run(BuildContext context) var nugets = context.GetFiles($"{Settings.ArtifactPath}/*.nupkg"); foreach (var package in nugets) { - context.NuGetPush( - package, - new NuGetPushSettings - { - Source = Settings.NugetSource, - ApiKey = Settings.NugetReleaseToken - } - ); + try + { + context.NuGetPush( + package, + new NuGetPushSettings + { + Source = Settings.NugetSource, + ApiKey = Settings.NugetReleaseToken + } + ); + } + catch (Exception e) + { + Console.WriteLine(e); + throw; + } + } var symbols = context.GetFiles($"{Settings.ArtifactPath}/*.snupkg"); foreach (var symbol in symbols)