Skip to content

Commit 8333803

Browse files
committed
Update push-nuget.sh script
1 parent c0ffabb commit 8333803

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

tools/push-nuget.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
2+
set -euo pipefail
23

34
cd ../src
4-
5-
dotnet build
6-
dotnet publish
75
dotnet pack
86

9-
latest_package=$(ls ./bin/Release/ChatAIze.PluginApi.*.*.*.nupkg | sort -V | tail -n 1)
7+
nupkg=$(ls ./bin/Release/ChatAIze.PluginApi.*.nupkg | grep -v '\.snupkg$' | sort -V | tail -n1)
8+
snupkg="${nupkg%.nupkg}.snupkg"
109

11-
dotnet nuget push "$latest_package" --api-key "$CHATAIZE_NUGET_API_KEY" --source "https://api.nuget.org/v3/index.json"
12-
dotnet nuget push "$latest_package" --api-key "$GITHUB_PAT" --source "https://nuget.pkg.github.com/chataize/index.json"
10+
dotnet nuget push "$nupkg" --api-key "$CHATAIZE_NUGET_API_KEY" --source "https://api.nuget.org/v3/index.json" --skip-duplicate
11+
dotnet nuget push "$snupkg" --api-key "$CHATAIZE_NUGET_API_KEY" --source "https://api.nuget.org/v3/index.json" --skip-duplicate
12+
dotnet nuget push "$nupkg" --api-key "$GITHUB_PAT" --source "https://nuget.pkg.github.com/chataize/index.json" --skip-duplicate
13+
dotnet nuget push "$snupkg" --api-key "$GITHUB_PAT" --source "https://nuget.pkg.github.com/chataize/index.json" --skip-duplicate

0 commit comments

Comments
 (0)