Skip to content

Commit 3dae72a

Browse files
committed
test
1 parent 1b79dad commit 3dae72a

1 file changed

Lines changed: 10 additions & 25 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
name: Build and release OptimizerNXT
22

33
on:
4-
workflow_dispatch:
4+
push:
5+
tags:
6+
- 'v*'
57

68
jobs:
79
build:
@@ -32,34 +34,17 @@ jobs:
3234
3335
- name: Create release description
3436
run: |
35-
$newVersion = "v0.0.3"
36-
$changelogPath = "./CHANGELOG.md"
37-
$exePath = "./optimizerNXT/bin/Release/optimizerNXT.exe"
38-
$bodyPath = "./release-body.md"
39-
40-
$sha256 = Get-FileHash "$exePath" -Algorithm SHA256
41-
$changelog = Get-Content $changelogPath -Raw
42-
43-
$pattern = "## \[$newVersion\].*?(\r?\n## |\z)"
44-
$match = [regex]::Match($changelog, $pattern, [System.Text.RegularExpressions.RegexOptions]::Singleline)
45-
46-
if (-not $match.Success) {
47-
Write-Host "⚠️ Changelog for version $newVersion not found"
48-
exit 1
49-
}
50-
51-
$section = $match.Value -replace "\r?\n## .*$", ""
52-
$releaseBody = "SHA256: $($sha256.Hash)`r`n`r`n$section"
53-
$releaseBody | Out-File -Encoding UTF8 $bodyPath
54-
Write-Host "Release description created at $bodyPath"
55-
37+
$sha256 = Get-FileHash "./optimizerNXT/bin/Release/optimizerNXT.exe" -Algorithm SHA256
38+
$bodyPath = "./release-body.md"
39+
"SHA256: $($sha256.Hash)" | Out-File -Encoding UTF8 $bodyPath
5640
5741
- name: Create release with tag
5842
uses: ncipollo/release-action@v1
5943
with:
60-
tag: v0.0.3
61-
name: OptimizerNXT v0.0.3
44+
tag: ${{ github.ref_name }}
45+
name: OptimizerNXT ${{ github.ref_name }}
6246
allowUpdates: true
6347
replacesArtifacts: true
64-
bodyFile: "./release-body.md"
48+
generateReleaseNotes: true
49+
bodyFile: "./release-body.md"
6550
artifacts: "./optimizerNXT/bin/Release/optimizerNXT.exe"

0 commit comments

Comments
 (0)