@@ -28,29 +28,27 @@ if ($(`git status --porcelain`)) {
28
28
29
29
let projectId = "dbup-sqlserver-scripting" ;
30
30
let projectName = "DbUp.Support.SqlServer.Scripting" ;
31
- let libCsproj = "DbUp.Support.SqlServer.Scripting/DbUp.Support.SqlServer.Scripting.csproj"
32
31
let version = args [ 0 ] ;
33
32
let notes = args [ 1 ] ;
34
33
let preRelease = version . indexOf ( "-" ) > - 1 ; // If version contains a '-' character (i.e. 2.0.0-alpha-1) we will consider this a pre-release
35
34
let projectCopyright = `Copyright ${ ( new Date ) . getFullYear ( ) } ` ;
36
35
let ghRepo = "bradymholt/dbup-sqlserver-scripting" ;
37
- let buildDir = "tmp" ;
36
+ let buildDirectory = "tmp" ;
38
37
39
- // Build, pack, and push to NuGet
40
- eval ( `dotnet build -c release ${ libCsproj } ` ) ;
41
- eval ( `dotnet pack -c release --no-build ${ libCsproj } ` ) ;
42
- eval ( `dotnet nuget push ${ buildDir } /${ nupkgFile } -k ${ env . NUGET_API_KEY } ` ) ;
38
+ // Restore NuGet pakcages and build in release mode
39
+ eval ( `nuget restore` ) ;
40
+ eval ( `xbuild /property:Configuration=Release ${ projectName } .sln` ) ;
43
41
44
42
// Create NuGet package
45
- eval ( `mkdir -p ${ buildDir } /pack/lib/net35` )
43
+ eval ( `mkdir -p ${ buildDirectory } /pack/lib/net35` )
46
44
eval ( `cp dbup-sqlserver-scripting.nuspec tmp/pack` )
47
- eval ( `cp -r tools dbup-sqlserver-scripting.nuspec ${ buildDir } /pack/` )
48
- eval ( `cp -r ${ projectName } /bin/Release/${ projectName } .* ${ buildDir } /pack/lib/net35` )
49
- eval ( `nuget pack ${ buildDir } /pack/${ projectId } .nuspec -Properties "version=${ version } ;notes=v${ version } - ${ notes } ;copyright=${ projectCopyright } " -OutputDirectory ${ buildDir } ` )
50
- let nupkgFile = `${ buildDir } /${ projectId } .${ version } .nupkg` ;
45
+ eval ( `cp -r tools dbup-sqlserver-scripting.nuspec ${ buildDirectory } /pack/` )
46
+ eval ( `cp -r ${ projectName } /bin/Release/${ projectName } .* ${ buildDirectory } /pack/lib/net35` )
47
+ eval ( `nuget pack ${ buildDirectory } /pack/${ projectId } .nuspec -Properties "version=${ version } ;notes=v${ version } - ${ notes } ;copyright=${ projectCopyright } " -OutputDirectory ${ buildDirectory } ` )
48
+ let nupkgFile = `${ buildDirectory } /${ projectId } .${ version } .nupkg` ;
51
49
52
- // Commit changes to project file
53
- eval ( `git commit -am "New release: ${ version } "` ) ;
50
+ // Push NuGet package
51
+ eval ( `nuget push ${ nupkgFile } -Source https://www.nuget.org/api/v2/package` )
54
52
55
53
// Create release tag
56
54
eval ( `git tag -a ${ version } -m "${ notes } "` ) ;
@@ -69,6 +67,6 @@ eval(`curl -H "Authorization: token ${env.GITHUB_API_TOKEN}" -H "Content-Type: a
69
67
--data-binary @"${ nupkgFile } " \
70
68
https://uploads.github.com/repos/${ ghRepo } /releases/${ releaseId } /assets?name=${ nupkgFile } ` ) ;
71
69
72
- eval ( `rm -r ${ buildDir } ` )
70
+ eval ( `rm -r ${ buildDirectory } ` )
73
71
74
72
echo ( `DONE! Released version ${ version } to NuGet and GitHub.` ) ;
0 commit comments