-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
71 lines (57 loc) · 2.39 KB
/
build.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
if [ -z "$1" ];
then
echo No version specified! Please specify a valid version like 1.2.3 or 1.2.3-rc1!
exit 1
fi
if [ -z "$2" ];
then
echo No release info specified! For a relase provide the r flag and a valid release verion!
exit 1
fi
echo ----
echo Starting building version $1
echo ----
echo Cleaning up
rm -r ./dist
echo ----
echo Restore solution
dotnet restore openiddict-ui.sln
echo ----
if [ $2 = "r" ];
then
echo Packaging solution with Version = $1
dotnet pack src/suite/OpenIddict.UI.Suite.Core -c Release -p:PackageVersion=$1 -p:Version=$1 -o ./dist/nupkgs/
dotnet pack src/suite/OpenIddict.UI.Suite.Api -c Release -p:PackageVersion=$1 -p:Version=$1 -o ./dist/nupkgs/
dotnet pack src/openiddict/OpenIddict.UI.Infrastructure -c Release -p:PackageVersion=$1 -p:Version=$1 -o ./dist/nupkgs/
dotnet pack src/openiddict/OpenIddict.UI.Api -c Release -p:PackageVersion=$1 -p:Version=$1 -o ./dist/nupkgs/
dotnet pack src/identity/OpenIddict.UI.Identity.Core -c Release -p:PackageVersion=$1 -p:Version=$1 -o ./dist/nupkgs/
dotnet pack src/identity/OpenIddict.UI.Identity.Infrastructure -c Release -p:PackageVersion=$1 -p:Version=$1 -o ./dist/nupkgs/
dotnet pack src/identity/OpenIddict.UI.Identity.Api -c Release -p:PackageVersion=$1 -p:Version=$1 -o ./dist/nupkgs/
else
echo Packaging solution with PackageVersion = $1
dotnet pack src/suite/OpenIddict.UI.Suite.Core -c Release -p:PackageVersion=$1 -o ./dist/nupkgs/
dotnet pack src/suite/OpenIddict.UI.Suite.Api -c Release -p:PackageVersion=$1 -o ./dist/nupkgs/
dotnet pack src/openiddict/OpenIddict.UI.Infrastructure -c Release -p:PackageVersion=$1 -o ./dist/nupkgs/
dotnet pack src/openiddict/OpenIddict.UI.Api -c Release -p:PackageVersion=$1 -o ./dist/nupkgs/
dotnet pack src/identity/OpenIddict.UI.Identity.Core -c Release -p:PackageVersion=$1 -o ./dist/nupkgs/
dotnet pack src/identity/OpenIddict.UI.Identity.Infrastructure -c Release -p:PackageVersion=$1 -o ./dist/nupkgs/
dotnet pack src/identity/OpenIddict.UI.Identity.Api -c Release -p:PackageVersion=$1 -o ./dist/nupkgs/
fi
if [ -z "$3" ];
then
echo ----
echo Done
exit 0
fi
echo ----
echo Pushing packages
for package in $(find ./dist/nupkgs/ -name *.nupkg); do
dotnet nuget push $package -k $3 -s https://api.nuget.org/v3/index.json
done
echo ----
echo Creating and pushing tag
git tag -a v$1 -m '"version '$1'"'
git push origin v$1
echo ----
echo Done