Skip to content

Commit

Permalink
ci: fix auto relase description
Browse files Browse the repository at this point in the history
  • Loading branch information
NateScarlet committed Mar 25, 2021
1 parent b07c595 commit 00e2e97
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
6 changes: 6 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ build_script:
- make build
after_build:
- 7z a -tzip -xr!.* -xr0!build build\\WuLiFang-Nuke-%APPVEYOR_REPO_TAG_NAME%-win.zip
- ps: |
${env:APPVEYOR_RELEASE_DESCRIPTION} = ./scripts/get_changelog.ps1 -Version v2021.0.1
Write-Host ${env:APPVEYOR_RELEASE_DESCRIPTION}
artifacts:
- path: build\WuLiFang-Nuke-*.zip
name: Built package
before_deploy:
- ps: |
${env:APPVEYOR_RELEASE_DESCRIPTION} = ./scripts/get_changelog.ps1 -Version $env:APPVEYOR_REPO_TAG_NAME
deploy:
tag: $(APPVEYOR_REPO_TAG_NAME)
release: $(APPVEYOR_REPO_TAG_NAME)
Expand Down
30 changes: 30 additions & 0 deletions scripts/get_changelog.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
param (
[Parameter()]
[String]
$Version
)

$ret = @()
$isMatch = $false
foreach ($line in Get-Content -Encoding utf8 docs/changelog.md) {
if ($line -match "## \[(?<version>.+)]") {
if ($Matches.version -eq ($Version -replace "^v", "")) {
$isMatch = $true
}
elseif ($isMatch) {
break
}
continue
}

if ($isMatch) {
$ret += $line
}
}

if ($ret.Length -eq 0) {
throw "Version not found: $Version"
}


return $ret -join "`n"

0 comments on commit 00e2e97

Please sign in to comment.