Skip to content

Commit

Permalink
Add package release notes via file (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
atifaziz authored Dec 28, 2021
1 parent 8b4674e commit d332d50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,27 @@ build_script:
dotnet build --configuration $env:CONFIGURATION
if ($isWindows) {
$versionSuffix = ([datetimeoffset]$env:APPVEYOR_REPO_COMMIT_TIMESTAMP).ToUniversalTime().ToString('yyyyMMdd''t''HHmm')
$nl = "`r`n"
$releaseNotesFile = [System.IO.Path]::GetTempFileName()
$tag = $env:APPVEYOR_REPO_TAG_NAME
# if the tag starts with "v", as in "v1.0.0", assume it's a release
if ($tag -clike 'v*') {
$url = (git remote get-url (git remote)) -replace '\.git$', ''
if ($LASTEXITCODE) { throw; }
$releaseNotes += "See: ${url}/releases/tag/$tag" + $nl + $nl
Add-Content $releaseNotesFile -Encoding UTF8 "See: ${url}/releases/tag/$tag"
Add-Content $releaseNotesFile -Encoding UTF8 ''
# if tag ends in "-" followed by dot-separated identifiers...
if ($tag -match '(?<=-)[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*$') {
$versionSuffix = $matches[0] # ...then use as suffix for pre-release
} else {
$versionSuffix = $null # ... else use no suffix for a release
}
}
$releaseNotes += "Commit @ $(git rev-parse HEAD)" + $nl
Add-Content $releaseNotesFile -Encoding UTF8 "Commit @ $(git rev-parse HEAD)"
$packArgs = @()
if ($versionSuffix) {
$packArgs += @('--version-suffix', $versionSuffix)
}
dotnet pack --no-build --configuration $env:CONFIGURATION @packArgs "-p:PackageReleaseNotes=$releaseNotes"
dotnet pack --no-build --configuration $env:CONFIGURATION @packArgs "-p:PackageReleaseNotesFile=$releaseNotesFile"
if ($LASTEXITCODE) { throw; }
Get-ChildItem -File -Filter docopt.net.*.nupkg dist |
Select-Object -ExpandProperty FullName |
Expand Down
1 change: 1 addition & 0 deletions src/DocoptNet/DocoptNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<PackageProjectUrl>https://github.com/docopt/docopt.net</PackageProjectUrl>
<PackageIcon>PackageIcon.png</PackageIcon>
<PackageOutputPath>..\..\dist</PackageOutputPath>
<PackageReleaseNotes Condition="'$(PackageReleaseNotes)' == '' And '$(PackageReleaseNotesFile)' != ''">$([System.IO.File]::ReadAllText('$(PackageReleaseNotesFile)'))</PackageReleaseNotes>
<Title>docopt.net, a beautiful command-line parser</Title>
<Authors>Dinh Doan Van Bien;Vladimir Keleshev</Authors>
<Description>docopt.net is the .net version of the docopt python beautiful command line parser. docopt.net helps you define an interface for your command-line app, and automatically generate a parser for it. docopt.net is based on conventions that have been used for decades in help messages and man pages for program interface description. Interface description in docopt.net is such a help message, but formalized. Check out http://docopt.org for a more detailed explanation.
Expand Down

0 comments on commit d332d50

Please sign in to comment.