-
Notifications
You must be signed in to change notification settings - Fork 0
/
nugetPublisher.sh
executable file
·31 lines (23 loc) · 824 Bytes
/
nugetPublisher.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
while getopts ":a:v:h" flag;
do
case "${flag}" in
a) apikey=${OPTARG};;
v) version=${OPTARG};;
h) echo "[-a apikey] | [-v version]";;
\?) echo "Invalid option: -$OPTARG" 1>&2;;
: ) echo "Invalid option: -$OPTARG requires an argument" 1>&2;;
esac
done
echo "ApiKey: $apikey";
echo "Version: $version";
echo "Nuget package: Trendyol.Middleware.${version}.nupkg"
echo "Creating dotnet package"
dotnet publish -c release -f net5.0
dotnet publish -c release -f netcoreapp3.1
dotnet publish -c release -f netcoreapp2.2
dotnet publish -c release -f netcoreapp2.0
echo "Creating nuget package"
dotnet pack --configuration Release
echo "Push nuget"
dotnet nuget push ./src/bin/Release/Trendyol.TyMiddleware.${version}.nupkg --api-key ${apikey} --source https://api.nuget.org/v3/index.json