Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create chocolatey package as a part of the build #24

Merged
merged 7 commits into from
Dec 31, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
build_script:
- ps: .\build.ps1 -Target "Appveyor"

artifacts:
- path: package\*.zip
- path: package\*.nupkg

# AppVeyor defaults to just its build number
version: '{build}'

# disable built-in tests.
test: off
test: off

artifacts:
- path: package\*.zip
- path: package\*.nupkg

deploy:
- provider: NuGet
server: https://www.myget.org/F/nunit/api/v2
api_key:
secure: wtAvJDVl2tfwiVcyLExFHLvZVfUWiQRHsfdHBFCNEATeCHo1Nd8JP642PfY8xhji
skip_symbols: true
on:
branch: master
29 changes: 25 additions & 4 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var configuration = Argument("configuration", "Release");
// SET PACKAGE VERSION
//////////////////////////////////////////////////////////////////////

var version = "0.9.1";
var version = "1.0";
var modifier = "";

var isAppveyor = BuildSystem.IsRunningOnAppVeyor;
Expand Down Expand Up @@ -121,9 +121,9 @@ Task("Test")
Task("PackageZip")
.Does(() =>
{
var path = PACKAGE_DIR + "NUnit-Project-Editor-" + packageVersion + dbgSuffix + ".zip";
var path = PACKAGE_DIR + "nunit-project-editor-" + packageVersion + dbgSuffix + ".zip";

CreateDirectory(PACKAGE_DIR);
EnsureDirectoryExists(PACKAGE_DIR);

CopyFileToDirectory("LICENSE.txt", BIN_DIR);
CopyFileToDirectory("CHANGES.txt", BIN_DIR);
Expand All @@ -139,6 +139,26 @@ Task("PackageZip")
Zip(BIN_DIR, File(path), zipFiles);
});

Task("PackageChocolatey")
.Does(() =>
{
EnsureDirectoryExists("PACKAGE_DIR");

ChocolateyPack("nunit-project-editor.nuspec",
new ChocolateyPackSettings()
{
Version = packageVersion,
OutputDirectory = PACKAGE_DIR,
Files = new []
{
new ChocolateyNuSpecContent { Source = "LICENSE.txt" },
new ChocolateyNuSpecContent { Source = "CHANGES.txt" },
new ChocolateyNuSpecContent { Source = BIN_DIR + "nunit-editor.exe", Target = "tools" },
new ChocolateyNuSpecContent { Source = BIN_DIR + "nunit.ico", Target = "tools" },
}
});
});

//////////////////////////////////////////////////////////////////////
// HELPER METHODS
//////////////////////////////////////////////////////////////////////
Expand All @@ -160,7 +180,8 @@ Task("Rebuild")
.IsDependentOn("Build");

Task("Package")
.IsDependentOn("PackageZip");
.IsDependentOn("PackageZip")
.IsDependentOn("PackageChocolatey");

Task("Appveyor")
.IsDependentOn("Build")
Expand Down
13 changes: 11 additions & 2 deletions nunit-editor.sln
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit-editor", "src\editor\nunit-editor.csproj", "{ED57DCEC-3C16-4A90-BD3C-4D5BE5AD70FB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit-editor.tests", "src\tests\nunit-editor.tests.csproj", "{A9E1C1E9-AE97-4510-AD94-EAFADE425FBE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B391C3C8-08C3-4638-A1BC-9FE5C094D9F9}"
ProjectSection(SolutionItems) = preProject
appveyor.yml = appveyor.yml
build.cake = build.cake
nunit-project-editor.nuspec = nunit-project-editor.nuspec
EndProjectSection
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What benefit is adding these 2 files to the solution? Ease of editing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. :-)

EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
25 changes: 25 additions & 0 deletions nunit-project-editor.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!-- Do not remove this test for UTF-8: if “Ω” doesn’t appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. -->
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>nunit-project-editor</id>
<version>0.0.0</version>
<packageSourceUrl>https://github.com/nunit/nunit-project-editor</packageSourceUrl>
<owners>Charlie Poole</owners>

<title>NUnit Project Editor</title>
<authors>Charlie Poole</authors>
<projectUrl>https://github.com/nunit/nunit-project-editor</projectUrl>
<iconUrl>http://cdn.rawgit.com/nunit/resources/master/images/icon/nunit_256.png</iconUrl>
<copyright>2016 Charlie Poole</copyright>
<licenseUrl>http://github.com/nunit/nunit-project-editor/blob/master/LICENSE.txt</licenseUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<projectSourceUrl>https://github.com/nunit/nunit-project-editor</projectSourceUrl>
<docsUrl>https://github.com/nunit/docs/wiki/Project-Editor</docsUrl>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good shout including this! Chocolatey also has a supportUrl and bugTrackerUrl - which could be good additions? 😄

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can include them if you think it's helpful (it's optional as far as chocolatey.org is concerned).

Not sure whether to use a mailto: or the google groups url for support. You need to have a google id for the latter, so maybe the email is better.

Copy link
Contributor

@ChrisMaddock ChrisMaddock Dec 28, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd personally prefer a URL, mailto links are often naff when you use an online email client! That's just a personal preference however. 😄

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Off the top of my head, not sure how a mailto: url would be rendered via the markdown engine, so probably safer to stick with a URL.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChrisMaddock supportUrl is not accepted. I used mailingListUrl

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops sorry - looks like that one's planned but not implemented yet. Can't remember where I found it.

<mailingListUrl>https://groups.google.com/forum/#!forum/nunit-discuss</mailingListUrl>
<bugTrackerUrl>https://github.com/nunit/nunit-project-editor/issues</bugTrackerUrl>
<tags>nunit project editor unit testing</tags>
<summary>Editor for NUnit Test Projects</summary>
<description>NUnit supports NUnit projects (extension .nunit) to define a collection of test assemblies that are loaded and run together. This tool is used to edit the contents of an NUnit Test Project.</description>
<releaseNotes>This is the first independent production release of the editor, which was previously bundled with NUnit V2.</releaseNotes>
</metadata>
</package>