diff --git a/GitReleaseManager.yaml b/GitReleaseManager.yaml new file mode 100644 index 0000000000..0a297c5458 --- /dev/null +++ b/GitReleaseManager.yaml @@ -0,0 +1,64 @@ +create: + include-footer: true + footer-heading: Where to get it + footer-content: You can download this release from [nuget.org](https://www.nuget.org/packages/reactiveui/{milestone}) + footer-includes-milestone: true + milestone-replace-text: '{milestone}' +export: + include-created-date-in-title: true + created-date-string-format: MMMM dd, yyyy + perform-regex-removal: true + regex-text: '### Where to get it(\r\n)*You can .*\)' + multiline-regex: true +issue-labels-include: +- reactiveui-core +- reactiveui-events +- windows-forms +- windows-phone-store-uwp +- uwp +- wpf +- xamarin-android +- xamarin-forms +- xamarin-ios +- xamarin-mac +- housekeeping +- documentation +issue-labels-exclude: +- Build +issue-labels-alias: + - name: reactiveui-core + header: All Platforms + plural: All Platforms + - name: reactiveui-events + header: Events Generator + plural: Events Generator + - name: windows-forms + header: Windows Forms + plural: Windows Forms + - name: windows-phone-store-uwp + header: Windows Phone, Store and Universal + plural: Windows Phone, Store and Universal + - name: uwp + header: Windows Universal Platform + plural: Windows Universal Platform + - name: wpf + header: Windows Presentation Framework + plural: Windows Presentation Framework + - name: xamarin-android + header: Xamarin Android + plural: Xamarin Android + - name: xamarin-forms + header: Xamarin Forms + plural: Xamarin Forms + - name: xamarin-ios + header: Xamarin iOS + plural: Xamarin iOS + - name: xamarin-mac + header: Xamarin Mac + plural: Xamarin Mac + - name: housekeeping + header: Housekeeping + plural: Housekeeping + - name: Documentation + header: Documentation + plural: Documentation diff --git a/GitVersion.yml b/GitVersion.yml new file mode 100644 index 0000000000..ab708be957 --- /dev/null +++ b/GitVersion.yml @@ -0,0 +1,15 @@ +assembly-versioning-scheme: None +next-version: 7.0.0 +branches: + master: + mode: ContinuousDelivery + tag: + increment: Patch + prevent-increment-of-merged-branch-version: true + track-merge-target: false + dev(elop)?(ment)?$: + mode: ContinuousDeployment + tag: alpha + increment: Minor + prevent-increment-of-merged-branch-version: false + track-merge-target: true \ No newline at end of file diff --git a/README.md b/README.md index fa34bcc78f..f2cb011414 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # ![ReactiveUI Logo](https://i.imgur.com/23kfbS9.png) ReactiveUI -[![Release Version](https://img.shields.io/github/release/reactiveui/reactiveui.svg)](https://github.com/reactiveui/reactiveui/releases) [![NuGet Stats](https://img.shields.io/nuget/dt/reactiveui-core.svg)](https://www.nuget.org/packages/reactiveui) [![#yourfirstpr](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](https://github.com/reactiveui/ReactiveUI/issues?utf8=%E2%9C%93&q=label%3Afirst-timers-only+) [![Issue Stats](http://www.issuestats.com/github/reactiveui/reactiveui/badge/issue?style=flat)](http://www.issuestats.com/github/reactiveui/reactiveui) [![Pull Request Stats](http://www.issuestats.com/github/reactiveui/reactiveui/badge/pr?style=flat)](http://www.issuestats.com/github/reactiveui/reactiveui) +[![Release Version](https://img.shields.io/github/release/reactiveui/reactiveui.svg)](https://github.com/reactiveui/reactiveui/releases) [![NuGet Stats](https://img.shields.io/nuget/dt/reactiveui-core.svg)](https://www.nuget.org/packages/reactiveui) [![#yourfirstpr](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](https://github.com/reactiveui/ReactiveUI/issues?utf8=%E2%9C%93&q=label%3Afirst-timers-only+) [![Issue Stats](http://www.issuestats.com/github/reactiveui/reactiveui/badge/issue?style=flat)](http://www.issuestats.com/github/reactiveui/reactiveui) [![Pull Request Stats](http://www.issuestats.com/github/reactiveui/reactiveui/badge/pr?style=flat)](http://www.issuestats.com/github/reactiveui/reactiveui) [![Build status](https://ci.appveyor.com/api/projects/status/nhsndp7v788t6a2m/branch/develop?svg=true)](https://ci.appveyor.com/project/ghuntley/reactiveui/branch/develop) + [![Follow us on Twitter](https://img.shields.io/badge/twitter-%40reactivexui-020031.svg)](https://twitter.com/reactivexui) [![Visit our website](https://img.shields.io/badge/website-reactiveui.net-020031.svg) ](http://www.reactiveui.net/) diff --git a/RELEASENOTES.md b/RELEASENOTES.md deleted file mode 100644 index 274f95961d..0000000000 --- a/RELEASENOTES.md +++ /dev/null @@ -1,2 +0,0 @@ -### New in 7.0.0 (work in progress) -If you are reading this, then please come join us in Slack. diff --git a/appveyor.yml b/appveyor.yml index 3a65b90d7f..2b2d7e0936 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,47 +1,75 @@ -version: 1.0.{build} - -branches: - only: - - rxui7-master - -environment: - ANDROID_HOME: "C:\\android-sdk-windows" - - MYGET_API_KEY: - secure: YP/3KxC2ffsuHNaolPXj66JVGzSjON9FcR2S2OEzn9c6SV14oPzUh1ySyeT+G+aA - SONAR_API_KEY: - secure: 1WyG/T61dXeEzB33DQE5M7qDMwiJ2tALpRF9jJlK3f6oiv6K+L4gp+q8llYh4951 - -xamarin: - email: ghuntley@ghuntley.com - password: - secure: 9PLfbvP3ON+Xk17Yd4rJag== - android: true - ios: true - -init: +# configuration for "master" branch +- + image: Visual Studio 2015 + branches: + only: + - master + version: 1.0.{build} + environment: + ANDROID_HOME: "C:\\android-sdk-windows" + GITHUB_USERNAME: + secure: 0Q9MvUId56SizmZwCf0cgg== + GITHUB_TOKEN: + secure: 8MW7NQw/+0kKQAINvV7mxac+f7xqrLPkskONTyldqcYP6M1h9iej2p7rSva0/rXH + NUGET_SOURCE: https://www.nuget.org/api/v2/package + NUGET_APIKEY: + secure: 0g2AqQxgiAIFhqoJbbmEPrJa15Z8U5xYT6vQe43Gocuxbjw74hBAIKbU+Cj65UNd + init: - cd \ - appveyor DownloadFile http://dl.google.com/android/android-sdk_r24.4.1-windows.zip - 7z x android-sdk_r24.4.1-windows.zip > nul - cd "C:\projects\reactiveui" - -install: - + install: - echo y | "%ANDROID_HOME%\tools\android.bat" update sdk -u -a -t tools - echo y | "%ANDROID_HOME%\tools\android.bat" update sdk -u -a -t platform-tools - echo y | "%ANDROID_HOME%\tools\android.bat" update sdk -u -a -t build-tools-24.0.2 - echo y | "%ANDROID_HOME%\tools\android.bat" update sdk -u -a -t android-24 - echo y | "%ANDROID_HOME%\tools\android.bat" update sdk -u -a -t extra-google-m2repository - echo y | "%ANDROID_HOME%\tools\android.bat" update sdk -u -a -t extra-android-m2repository - -build_script: -- ps: >- - - ./build.cmd - -test: off - -artifacts: - - path: '**/bin/**/*' + build_script: + - ./build.cmd + cache: + - tools -> build.* + - src\packages -> **\packages.config + - '%USERPROFILE%\.nuget\packages -> **\project.json' + artifacts: + - path: artifacts/* + - path: '**/bin/*' - path: src/ReactiveUI.Events/Events_*.cs + test: off + +# configuration for "develop" branch +- + image: Visual Studio 2015 + branches: + except: + - master + version: 1.0.{build} + environment: + ANDROID_HOME: "C:\\android-sdk-windows" + NUGET_SOURCE: https://www.myget.org/F/reactiveui/api/v2/package + NUGET_APIKEY: + secure: YP/3KxC2ffsuHNaolPXj66JVGzSjON9FcR2S2OEzn9c6SV14oPzUh1ySyeT+G+aA + init: + - cd \ + - appveyor DownloadFile http://dl.google.com/android/android-sdk_r24.4.1-windows.zip + - 7z x android-sdk_r24.4.1-windows.zip > nul + - cd "C:\projects\reactiveui" + install: + - echo y | "%ANDROID_HOME%\tools\android.bat" update sdk -u -a -t tools + - echo y | "%ANDROID_HOME%\tools\android.bat" update sdk -u -a -t platform-tools + - echo y | "%ANDROID_HOME%\tools\android.bat" update sdk -u -a -t build-tools-24.0.2 + - echo y | "%ANDROID_HOME%\tools\android.bat" update sdk -u -a -t android-24 + - echo y | "%ANDROID_HOME%\tools\android.bat" update sdk -u -a -t extra-google-m2repository + - echo y | "%ANDROID_HOME%\tools\android.bat" update sdk -u -a -t extra-android-m2repository + build_script: + - ./build.cmd + cache: + - tools -> build.* + - src\packages -> **\packages.config + - '%USERPROFILE%\.nuget\packages -> **\project.json' + artifacts: - path: artifacts/* + - path: '**/bin/*' + - path: src/ReactiveUI.Events/Events_*.cs + test: off diff --git a/build.cake b/build.cake index 80e4cb85f2..be51369b34 100644 --- a/build.cake +++ b/build.cake @@ -8,8 +8,9 @@ // TOOLS ////////////////////////////////////////////////////////////////////// -#tool GitVersion.CommandLine -#tool GitLink +#tool "GitReleaseManager" +#tool "GitVersion.CommandLine" +#tool "GitLink" ////////////////////////////////////////////////////////////////////// // ARGUMENTS @@ -21,53 +22,40 @@ if (string.IsNullOrWhiteSpace(target)) target = "Default"; } -var configuration = Argument("configuration", "Release"); - ////////////////////////////////////////////////////////////////////// // PREPARATION ////////////////////////////////////////////////////////////////////// -// should MSBuild & GitLink treat any errors as warnings. +// Should MSBuild & GitLink treat any errors as warnings? var treatWarningsAsErrors = false; -// Get whether or not this is a local build. +// Build configuration var local = BuildSystem.IsLocalBuild; -Information("local={0}", local); - var isRunningOnUnix = IsRunningOnUnix(); -Information("isRunningOnUnix={0}", isRunningOnUnix); - var isRunningOnWindows = IsRunningOnWindows(); -Information("isRunningOnWindows={0}", isRunningOnWindows); -//var isRunningOnBitrise = Bitrise.IsRunningOnBitrise; var isRunningOnAppVeyor = AppVeyor.IsRunningOnAppVeyor; -Information("isRunningOnAppVeyor={0}", isRunningOnAppVeyor); - var isPullRequest = AppVeyor.Environment.PullRequest.IsPullRequest; -Information("isPullRequest={0}", isPullRequest); - -var isMainReactiveUIRepo = StringComparer.OrdinalIgnoreCase.Equals("reactiveui/reactiveui", AppVeyor.Environment.Repository.Name); -Information("isMainReactiveUIRepo={0}", isMainReactiveUIRepo); - -// Parse release notes. -var releaseNotes = ParseReleaseNotes("RELEASENOTES.md"); - -// Get version. -var version = releaseNotes.Version.ToString(); -Information("version={0}", version); +var isRepository = StringComparer.OrdinalIgnoreCase.Equals("reactiveui/reactiveui", AppVeyor.Environment.Repository.Name); -var epoch = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; -Information("epoch={0}", epoch); +var isReleaseBranch = StringComparer.OrdinalIgnoreCase.Equals("master", AppVeyor.Environment.Repository.Branch); +var isTagged = AppVeyor.Environment.Repository.Tag.IsTag; -var gitSha = GitVersion().Sha; -Information("gitSha={0}", gitSha); +var githubOwner = "reactiveui"; +var githubRepository = "reactiveui"; +var githubUrl = string.Format("https://github.com/{0}/{1}", githubOwner, githubRepository); -var semVersion = local ? string.Format("{0}.{1}", version, epoch) : string.Format("{0}.{1}", version, epoch); -Information("semVersion={0}", semVersion); +// Version +var gitVersion = GitVersion(); +var majorMinorPatch = gitVersion.MajorMinorPatch; +var semVersion = gitVersion.SemVer; +var informationalVersion = gitVersion.InformationalVersion; +var nugetVersion = gitVersion.NuGetVersion; +var buildVersion = gitVersion.FullBuildMetaData; -// Define directories. +// Artifacts var artifactDirectory = "./artifacts/"; +var packageWhitelist = new[] { "ReactiveUI-Testing", "ReactiveUI-Events", "ReactiveUI-Events-XamForms", "ReactiveUI", "ReactiveUI-Core", "ReactiveUI-AndroidSupport", "ReactiveUI-Blend", "ReactiveUI-Winforms", "ReactiveUI-XamForms" }; // Define global marcos. Action Abort = () => { throw new Exception("a non-recoverable fatal error occurred."); }; @@ -93,11 +81,11 @@ Action Package = (nuspec, basePath) => Copyright = "Copyright (c) ReactiveUI and contributors", RequireLicenseAcceptance = false, - Version = semVersion, + Version = nugetVersion, Tags = new [] {"mvvm", "reactiveui", "Rx", "Reactive Extensions", "Observable", "LINQ", "Events", "xamarin", "android", "ios", "forms", "monodroid", "monotouch", "xamarin.android", "xamarin.ios", "xamarin.forms", "wpf", "winforms", "uwp", "winrt", "net46", "netcore", "wp", "wpdev", "windowsphone", "windowsstore"}, - ReleaseNotes = new List(releaseNotes.Notes), + ReleaseNotes = new [] { string.Format("{0}/releases", githubUrl) }, - Symbols = true, + Symbols = false, Verbosity = NuGetVerbosity.Detailed, OutputDirectory = artifactDirectory, BasePath = basePath, @@ -124,7 +112,7 @@ Setup(context => throw new NotImplementedException("ReactiveUI will only build on Windows (w/Xamarin installed) because it's not possible to target UWP, WPF and Windows Forms from UNIX."); } - Information("Building version {0} of ReactiveUI.", semVersion); + Information("Building version {0} of ReactiveUI. (isTagged: {1})", informationalVersion, isTagged); }); Teardown(context => @@ -144,7 +132,7 @@ Task("BuildEventBuilder") var solution = "./src/EventBuilder.sln"; MSBuild(solution, new MSBuildSettings() - .SetConfiguration(configuration) + .SetConfiguration("Release") .WithProperty("TreatWarningsAsErrors", treatWarningsAsErrors.ToString()) .SetVerbosity(Verbosity.Minimal) .SetNodeReuse(false)); @@ -221,7 +209,7 @@ Task("BuildEvents") Information("Building {0}", solution); MSBuild(solution, new MSBuildSettings() - .SetConfiguration(configuration) + .SetConfiguration("Release") .WithProperty("NoWarn", "1591") // ignore missing XML doc warnings .WithProperty("TreatWarningsAsErrors", treatWarningsAsErrors.ToString()) .SetVerbosity(Verbosity.Minimal) @@ -259,7 +247,7 @@ Task("BuildReactiveUI") Information("Building {0}", solution); MSBuild(solution, new MSBuildSettings() - .SetConfiguration(configuration) + .SetConfiguration("Release") .WithProperty("NoWarn", "1591") // ignore missing XML doc warnings .WithProperty("TreatWarningsAsErrors", treatWarningsAsErrors.ToString()) .SetVerbosity(Verbosity.Minimal) @@ -292,7 +280,7 @@ Task("UpdateAppVeyorBuildNumber") .WithCriteria(() => isRunningOnAppVeyor) .Does(() => { - AppVeyor.UpdateBuildVersion(semVersion); + AppVeyor.UpdateBuildVersion(buildVersion); }); Task("UpdateAssemblyInfo") @@ -303,9 +291,9 @@ Task("UpdateAssemblyInfo") CreateAssemblyInfo(file, new AssemblyInfoSettings { Product = "ReactiveUI", - Version = version, - FileVersion = version, - InformationalVersion = semVersion, + Version = majorMinorPatch, + FileVersion = majorMinorPatch, + InformationalVersion = informationalVersion, Copyright = "Copyright (c) ReactiveUI and contributors" }); }); @@ -330,47 +318,114 @@ Task("RunUnitTests") Task("Package") .IsDependentOn("PackageEvents") .IsDependentOn("PackageReactiveUI") - .WithCriteria(() => !isRunningOnUnix) .Does (() => { }); -Task("Publish") +Task("PublishPackages") + .IsDependentOn("RunUnitTests") .IsDependentOn("Package") - .WithCriteria(() => !isRunningOnUnix) .WithCriteria(() => !local) .WithCriteria(() => !isPullRequest) - .WithCriteria(() => isMainReactiveUIRepo) + .WithCriteria(() => isRepository) .Does (() => { + + if (isReleaseBranch && !isTagged) + { + Information("Packages will not be published as this release has not been tagged."); + return; + } + // Resolve the API key. - var apiKey = EnvironmentVariable("MYGET_API_KEY"); + var apiKey = EnvironmentVariable("NUGET_APIKEY"); if (string.IsNullOrEmpty(apiKey)) { - throw new InvalidOperationException("Could not resolve MyGet API key."); + throw new Exception("The NUGET_APIKEY environment variable is not defined."); + } + + var source = EnvironmentVariable("NUGET_SOURCE"); + if (string.IsNullOrEmpty(source)) + { + throw new Exception("The NUGET_SOURCE environment variable is not defined."); } // only push whitelisted packages. - foreach(var package in new[] { "ReactiveUI-Testing", "ReactiveUI-Events", "ReactiveUI-Events-XamForms", "ReactiveUI", "ReactiveUI-Core", "ReactiveUI-AndroidSupport", "ReactiveUI-Blend", "ReactiveUI-Winforms", "ReactiveUI-XamForms" }) + foreach(var package in packageWhitelist) { // only push the package which was created during this build run. - var packagePath = artifactDirectory + File(string.Concat(package, ".", semVersion, ".nupkg")); - var symbolsPath = artifactDirectory + File(string.Concat(package, ".", semVersion, ".symbols.nupkg")); + var packagePath = artifactDirectory + File(string.Concat(package, ".", nugetVersion, ".nupkg")); // Push the package. NuGetPush(packagePath, new NuGetPushSettings { - Source = "https://www.myget.org/F/reactiveui/api/v2/package", + Source = source, ApiKey = apiKey }); + } +}); - // Push the symbols - NuGetPush(symbolsPath, new NuGetPushSettings { - Source = "https://www.myget.org/F/reactiveui/api/v2/package", - ApiKey = apiKey - }); +Task("CreateRelease") + .IsDependentOn("Package") + .WithCriteria(() => !local) + .WithCriteria(() => !isPullRequest) + .WithCriteria(() => isRepository) + .WithCriteria(() => isReleaseBranch) + .WithCriteria(() => !isTagged) + .Does (() => +{ + var username = EnvironmentVariable("GITHUB_USERNAME"); + if (string.IsNullOrEmpty(username)) + { + throw new Exception("The GITHUB_USERNAME environment variable is not defined."); + } + var token = EnvironmentVariable("GITHUB_TOKEN"); + if (string.IsNullOrEmpty(token)) + { + throw new Exception("The GITHUB_TOKEN environment variable is not defined."); } + + GitReleaseManagerCreate(username, token, githubOwner, githubRepository, new GitReleaseManagerCreateSettings { + Milestone = majorMinorPatch, + Name = majorMinorPatch, + Prerelease = true, + TargetCommitish = "master" + }); +}); + +Task("PublishRelease") + .IsDependentOn("RunUnitTests") + .IsDependentOn("Package") + .WithCriteria(() => !local) + .WithCriteria(() => !isPullRequest) + .WithCriteria(() => isRepository) + .WithCriteria(() => isReleaseBranch) + .WithCriteria(() => isTagged) + .Does (() => +{ + var username = EnvironmentVariable("GITHUB_USERNAME"); + if (string.IsNullOrEmpty(username)) + { + throw new Exception("The GITHUB_USERNAME environment variable is not defined."); + } + + var token = EnvironmentVariable("GITHUB_TOKEN"); + if (string.IsNullOrEmpty(token)) + { + throw new Exception("The GITHUB_TOKEN environment variable is not defined."); + } + + // only push whitelisted packages. + foreach(var package in packageWhitelist) + { + // only push the package which was created during this build run. + var packagePath = artifactDirectory + File(string.Concat(package, ".", nugetVersion, ".nupkg")); + + GitReleaseManagerAddAssets(username, token, githubOwner, githubRepository, majorMinorPatch, packagePath); + } + + GitReleaseManagerClose(username, token, githubOwner, githubRepository, majorMinorPatch); }); ////////////////////////////////////////////////////////////////////// @@ -378,9 +433,12 @@ Task("Publish") ////////////////////////////////////////////////////////////////////// Task("Default") - .IsDependentOn("Publish") + .IsDependentOn("CreateRelease") + .IsDependentOn("PublishPackages") + .IsDependentOn("PublishRelease") .Does (() => { + }); ////////////////////////////////////////////////////////////////////// diff --git a/src/.nuget/NuGet.Config b/src/.nuget/NuGet.Config index 0034d6e94e..b3c9469982 100644 --- a/src/.nuget/NuGet.Config +++ b/src/.nuget/NuGet.Config @@ -1,7 +1,7 @@ - + diff --git a/src/ReactiveUI.nuspec b/src/ReactiveUI.nuspec index 9c7b7ffa34..2dd67a7cfd 100644 --- a/src/ReactiveUI.nuspec +++ b/src/ReactiveUI.nuspec @@ -10,6 +10,6 @@ - +