/
push-nuget.ps1
53 lines (35 loc) · 1.3 KB
/
push-nuget.ps1
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
# parameters
$key = '__KEY__'
$version = '0.1.28'
# clean
dotnet clean .\GivenSpecs.sln
# apply version
setversion $version .\GivenSpecs\GivenSpecs.csproj
setversion $version .\GivenSpecs.Application\GivenSpecs.Application.csproj
setversion $version .\GivenSpecs.Application.Tests\GivenSpecs.Application.Tests.csproj
setversion $version .\GivenSpecs.CommandLine\GivenSpecs.CommandLine.csproj
setversion $version .\GivenSpecs.Tests\GivenSpecs.Tests.csproj
# build GivenSpecs
Push-Location
cd "GivenSpecs"
dotnet build --configuration=Release -p:Version=$version
#dotnet pack -c Release
nuget.exe pack -OutputDirectory ./nupkg -IncludeReferencedProjects -Version $version -Prop Configuration=Release
Pop-Location
# build GivenSpecs.CommandLine
Push-Location
cd "GivenSpecs.CommandLine"
dotnet build --configuration=Release -p:Version=$version
dotnet pack -c Release
#nuget.exe pack -OutputDirectory ./nupkg -IncludeReferencedProjects -Version $version
Pop-Location
# push GivenSpecs
Push-Location
cd "GivenSpecs/nupkg"
dotnet nuget push GivenSpecs.$version.nupkg -k $key -s https://api.nuget.org/v3/index.json
Pop-Location
# push GivenSpecs.CommandLine
Push-Location
cd "GivenSpecs.CommandLine/nupkg"
dotnet nuget push GivenSpecs.CommandLine.$version.nupkg -k $key -s https://api.nuget.org/v3/index.json
Pop-Location