EasyBuild.PackageReleaseNotes.Tasks
2.0.0
dotnet add package EasyBuild.PackageReleaseNotes.Tasks --version 2.0.0
NuGet\Install-Package EasyBuild.PackageReleaseNotes.Tasks -Version 2.0.0
<PackageReference Include="EasyBuild.PackageReleaseNotes.Tasks" Version="2.0.0"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add EasyBuild.PackageReleaseNotes.Tasks --version 2.0.0
#r "nuget: EasyBuild.PackageReleaseNotes.Tasks, 2.0.0"
// Install EasyBuild.PackageReleaseNotes.Tasks as a Cake Addin #addin nuget:?package=EasyBuild.PackageReleaseNotes.Tasks&version=2.0.0 // Install EasyBuild.PackageReleaseNotes.Tasks as a Cake Tool #tool nuget:?package=EasyBuild.PackageReleaseNotes.Tasks&version=2.0.0
EasyBuild.PackageReleaseNotes.Tasks
This project provides MSBuild tasks to automate setting the following properties based on the content of a CHANGELOG file:
Version
- The version of the latest releasePackageVersion
- The version of the latest releasePackageReleaseNotes
- The body of the latest release
Usage
Install
EasyBuild.PackageReleaseNotes.Tasks
from NuGetdotnet add package EasyBuild.PackageReleaseNotes.Tasks
If your CHANGELOG file is not named
CHANGELOG.md
, and beside your project file, you can set theChangelogFile
property in your project file.<PropertyGroup> <ChangelogFile>path/to/CHANGELOG.md</ChangelogFile> </PropertyGroup>
💡 You can use the MSBuild property
$(MSBuildThisFileDirectory)
to get the directory of the project file.<PropertyGroup> <ChangelogFile>$(MSBuildThisFileDirectory)path/to/CHANGELOG.md</ChangelogFile> </PropertyGroup>
What is the latest release?
The first version at the top of the file which is not Unreleased
is considered the latest release.
## [Unreleased]
## [1.0.0] - 2021-01-01
## [0.1.0] - 2020-01-01
In this example, 1.0.0
is the latest release.
Supported format
The tool is on purpose flexible on how a version is detected. It allows it to work with various formats like KeepAChangeLog, conventional commits based changelog.
It supports the following formats:
## 1.0.0 - 2021-01-01
## [1.0.0] - 2021-01-01
## v1.0.0 - 2021-01-01
## [v1.0.0] - 2021-01-01
## 1.0.0
## [1.0.0]
## v1.0.0
## [v1.0.0]
<details> <summary>Regex used to match the version</summary>
^ # Start of the string
## # Match literal "##"
\s # Match a space (whitespace character)
\[? # Optionally match an opening bracket '['
v? # Optionally match a literal 'v' (for version)
(?<version> # Start a named capture group for "version"
[\w\d.-]+ # Match one or more word characters (letters, digits), dots, or hyphens
\. # Match a literal dot (.)
[\w\d.-]+ # Match one or more word characters (letters, digits), dots, or hyphens again
[a-zA-Z0-9] # Match a single alphanumeric character (ensures no trailing dot/hyphen)
) # End the "version" capture group
\]? # Optionally match a closing bracket ']'
\s-\s # Match a literal space, hyphen, and space " - "
(?<date> # Start a named capture group for "date"
\d{4} # Match exactly 4 digits (year)
- # Match a literal hyphen "-"
\d{2} # Match exactly 2 digits (month)
- # Match a literal hyphen "-"
\d{2} # Match exactly 2 digits (day)
)? # The "date" group is optional (match 0 or 1 times)
$ # End of the string
</details>
MSBuild properties
The task exposes the following property:
CurrentRelease.Version
- The version of the latest release (without the leadingv
)CurrentRelease.Date
- The date of the latest releaseCurrentRelease.Body
- The body of the latest release
[!NOTE]
CurrentRelease
name is used in the sense that this is the release that is currently being processed.
Aknowledgements
This project has been inspired by Ionide.KeepAChangeLog. If you are using KeepAChangeLog format, you need a deeper integration with your CHANGELOG file, like accessing the different sections of a release, you should take a look at this project.
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.7.2
- No dependencies.
-
.NETStandard 2.1
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
## 2.0.0
### 🚀 Features
- Skip `Unreleased` version to support KeepAChangelog format ([fd1fed1](https://github.com/easybuild-org/EasyBuild.CommitLinter/commit/fd1fed1b7da8b7a80b2fb6966ea27493f5d5f3bf))
- If no version found in the changelog file, default to 0.0.0 ([d9a0f8b](https://github.com/easybuild-org/EasyBuild.CommitLinter/commit/d9a0f8be7c19485e3e50c87a8462c3152d848ae2))