Skip to content

Commit 4a8ee2d

Browse files
committed
Revert "Use dotnet command"
This reverts commit cd8baeb.
1 parent 66b1e02 commit 4a8ee2d

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

scripts/release.js

+12-14
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,27 @@ if ($(`git status --porcelain`)) {
2828

2929
let projectId = "dbup-sqlserver-scripting";
3030
let projectName = "DbUp.Support.SqlServer.Scripting";
31-
let libCsproj = "DbUp.Support.SqlServer.Scripting/DbUp.Support.SqlServer.Scripting.csproj"
3231
let version = args[0];
3332
let notes = args[1];
3433
let preRelease = version.indexOf("-") > -1; // If version contains a '-' character (i.e. 2.0.0-alpha-1) we will consider this a pre-release
3534
let projectCopyright = `Copyright ${(new Date).getFullYear()}`;
3635
let ghRepo = "bradymholt/dbup-sqlserver-scripting";
37-
let buildDir = "tmp";
36+
let buildDirectory = "tmp";
3837

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`);
4341

4442
// Create NuGet package
45-
eval(`mkdir -p ${buildDir}/pack/lib/net35`)
43+
eval(`mkdir -p ${buildDirectory}/pack/lib/net35`)
4644
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`;
5149

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`)
5452

5553
// Create release tag
5654
eval(`git tag -a ${version} -m "${notes}"`);
@@ -69,6 +67,6 @@ eval(`curl -H "Authorization: token ${env.GITHUB_API_TOKEN}" -H "Content-Type: a
6967
--data-binary @"${nupkgFile}" \
7068
https://uploads.github.com/repos/${ghRepo}/releases/${releaseId}/assets?name=${nupkgFile}`);
7169

72-
eval(`rm -r ${buildDir}`)
70+
eval(`rm -r ${buildDirectory}`)
7371

7472
echo(`DONE! Released version ${version} to NuGet and GitHub.`);

0 commit comments

Comments
 (0)