-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpublish.sh
More file actions
14 lines (10 loc) · 947 Bytes
/
publish.sh
File metadata and controls
14 lines (10 loc) · 947 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash
SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
PROJECTDIR="$(basename $SCRIPTPATH)"
JSONFILE="${SCRIPTPATH}/src/${PROJECTDIR}/obj/project.assets.json"
dotnet build --configuration Release
dotnet pack --configuration Release
# github source add dotnet nuget add source --username USER --password $GITHUBPAT --store-password-in-clear-text --name github "https://nuget.pkg.github.com/TirsvadCLI/index.json"
# GITHUBPAT is my secret key for github
dotnet nuget push "src/${PROJECTDIR}/bin/Release/$(jq -r '.project.restore.projectName' $JSONFILE).$(jq -r '.project.version' $JSONFILE).nupkg" --api-key $GITHUBPAT --source https://nuget.pkg.github.com/TirsvadCLI/index.json --skip-duplicate
dotnet nuget push "src/${PROJECTDIR}/bin/Release/$(jq -r '.project.restore.projectName' $JSONFILE).$(jq -r '.project.version' $JSONFILE).nupkg" --api-key $NUGETPAT --source https://api.nuget.org/v3/index.json --skip-duplicate