Setup publish script

This commit is contained in:
Jonas Dellinger 2020-06-04 20:40:34 +02:00
parent f04f175775
commit 14dd959354
2 changed files with 26 additions and 19 deletions

View File

@ -1,19 +0,0 @@
if "%APPVEYOR_REPO_TAG%" == "true" (
echo Publishing...
cd ./SpotifyAPI.Web
dotnet pack -c Release SpotifyAPI.Web.csproj -p:PackageVersion=%APPVEYOR_REPO_TAG_NAME%
nuget push ./bin/Release/SpotifyAPI.Web.%APPVEYOR_REPO_TAG_NAME%.nupkg -ApiKey %NUGET_TOKEN% -NonInteractive -Source https://www.nuget.org/api/v2/package
nuget push ./bin/Release/SpotifyAPI.Web.%APPVEYOR_REPO_TAG_NAME%.nupkg -NonInteractive -Source GitHub
cd ../SpotifyAPI.Web.Auth
dotnet pack -c Release SpotifyAPI.Web.Auth.csproj -p:PackageVersion=%APPVEYOR_REPO_TAG_NAME%
nuget push ./bin/Release/SpotifyAPI.Web.Auth.%APPVEYOR_REPO_TAG_NAME%.nupkg -ApiKey %NUGET_TOKEN% -NonInteractive -Source https://www.nuget.org/api/v2/package
nuget push ./bin/Release/SpotifyAPI.Web.Auth.%APPVEYOR_REPO_TAG_NAME%.nupkg -NonInteractive -Source GitHub
cd ..
) else (
echo Skipping Publishing
)

26
publish.sh Executable file
View File

@ -0,0 +1,26 @@
#!/bin/bash
set -e
if [ -n "$APPVEYOR_REPO_TAG" ]; then
echo "Publishing..."
sudo curl -o /usr/local/bin/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
alias nuget="mono /usr/local/bin/nuget.exe"
cd ./SpotifyAPI.Web
dotnet pack -c Release SpotifyAPI.Web.csproj -p:PackageVersion="$APPVEYOR_REPO_TAG_NAME"
nuget push "./bin/Release/SpotifyAPI.Web.$APPVEYOR_REPO_TAG_NAME.nupkg"\
-ApiKey "$NUGET_TOKEN"\
-NonInteractive\
-Source https://www.nuget.org/api/v2/package
cd ../SpotifyAPI.Web.Auth
dotnet pack -c Release SpotifyAPI.Web.Auth.csproj -p:PackageVersion="$APPVEYOR_REPO_TAG_NAME"
nuget push "./bin/Release/SpotifyAPI.Web.Auth.$APPVEYOR_REPO_TAG_NAME.nupkg"\
-ApiKey "$NUGET_TOKEN"\
-NonInteractive\
-Source https://www.nuget.org/api/v2/package
cd ..
fi