@@ -91,6 +91,73 @@ extends:
9191 Write-Host "Version: $fullVersion"
9292
9393 Write-Host "##vso[task.setvariable variable=version;isOutput=true]$fullVersion"
94+ - task : PowerShell@2
95+ displayName : " Generate Release Notes"
96+ continueOnError : true
97+ env :
98+ GH_TOKEN : $(GITHUB_TOKEN_2)
99+ GH_MODELS_TOKEN : $(GH_MODELS_TOKEN)
100+ inputs :
101+ pwsh : true
102+ filePath : ' $(System.DefaultWorkingDirectory)/scripts/generate-release-notes.ps1'
103+ arguments : ' -CurrentTag "v$(SetMeta.version)" -CurrentRef "$(Build.SourceVersion)" -OutputPath "$(Build.ArtifactStagingDirectory)/release-notes/release-notes.md"'
104+ - task : PowerShell@2
105+ displayName : " Compose Full Release Body"
106+ inputs :
107+ pwsh : true
108+ targetType : ' inline'
109+ script : |
110+ $outDir = "$(Build.ArtifactStagingDirectory)/release-notes"
111+ if (-not (Test-Path $outDir)) { New-Item -ItemType Directory -Path $outDir -Force | Out-Null }
112+
113+ $aiNotes = ""
114+ $notesPath = "$outDir/release-notes.md"
115+ if (Test-Path $notesPath) {
116+ $aiNotes = Get-Content $notesPath -Raw
117+ }
118+
119+ $versionJson = Get-Content "version.json" | ConvertFrom-Json
120+ $fullVersion = $versionJson.version
121+
122+ $lines = @(
123+ "## Installation Options"
124+ ""
125+ "### MSIX Installer (Recommended)"
126+ "1. Download ``winappcli_x64.msix`` for x64 or ``winappcli_arm64.msix`` for ARM64"
127+ "2. Double-click to install"
128+ "3. Automatically added to PATH"
129+ ""
130+ "### Standalone CLI Binaries"
131+ "1. Download ``winappcli-x64.zip`` for x64 or ``winappcli-arm64.zip`` for ARM64"
132+ "2. Extract to your desired location"
133+ "3. Add to PATH or run directly: ``winapp.exe``"
134+ ""
135+ "### NPM Package (for Electron or NodeJS)"
136+ "``````bash"
137+ "npm install microsoft-winappcli.tgz"
138+ "``````"
139+ ""
140+ "## What's Included"
141+ "- MSIX installer packages (x64 and ARM64)"
142+ "- Standalone CLI binaries (x64 and ARM64)"
143+ "- NPM package for NodeJS/Electron integration"
144+ )
145+ $installationNotes = $lines -join "`n"
146+
147+ $fullBody = "Version: ``$fullVersion```n"
148+ $fullBody += "Commit: ``$(Build.SourceVersion)```n`n"
149+ if ($aiNotes) {
150+ $fullBody += $aiNotes + "`n`n---`n`n"
151+ }
152+ $fullBody += $installationNotes
153+
154+ $fullBody | Set-Content "$outDir/full-release-notes.md" -Encoding UTF8 -NoNewline
155+ Write-Host "Release body written ($($fullBody.Length) chars)"
156+ - task : 1ES.PublishPipelineArtifact@1
157+ displayName : Upload Artifact - Release Notes
158+ inputs :
159+ path : ' $(Build.ArtifactStagingDirectory)/release-notes'
160+ artifactName : release-notes
94161
95162 - stage : Release_GitHub
96163 displayName : Create GitHub Release
@@ -118,6 +185,9 @@ extends:
118185 - input : pipelineArtifact
119186 artifactName : msix-packages
120187 targetPath : $(Pipeline.Workspace)/msix-packages
188+ - input : pipelineArtifact
189+ artifactName : release-notes
190+ targetPath : $(Pipeline.Workspace)/release-notes
121191 steps :
122192 - task : ArchiveFiles@2
123193 displayName : Archive CLI binaries - x64
@@ -150,67 +220,6 @@ extends:
150220 Rename-Item -Path $_.FullName -NewName $newName
151221 }
152222
153- - checkout : self
154- fetchDepth : 0
155-
156- - task : PowerShell@2
157- displayName : " Generate Release Notes"
158- continueOnError : true
159- env :
160- GH_TOKEN : $(GITHUB_TOKEN_2)
161- GH_MODELS_TOKEN : $(GH_MODELS_TOKEN)
162- inputs :
163- pwsh : true
164- filePath : ' $(System.DefaultWorkingDirectory)/scripts/generate-release-notes.ps1'
165- arguments : ' -CurrentTag "v$(version)" -CurrentRef "$(Build.SourceVersion)" -OutputPath "$(Pipeline.Workspace)/release-notes.md"'
166-
167- - task : PowerShell@2
168- displayName : " Compose Full Release Body"
169- inputs :
170- pwsh : true
171- targetType : ' inline'
172- script : |
173- $aiNotes = ""
174- $notesPath = "$(Pipeline.Workspace)/release-notes.md"
175- if (Test-Path $notesPath) {
176- $aiNotes = Get-Content $notesPath -Raw
177- }
178-
179- $lines = @(
180- "## Installation Options"
181- ""
182- "### MSIX Installer (Recommended)"
183- "1. Download ``winappcli_x64.msix`` for x64 or ``winappcli_arm64.msix`` for ARM64"
184- "2. Double-click to install"
185- "3. Automatically added to PATH"
186- ""
187- "### Standalone CLI Binaries"
188- "1. Download ``winappcli-x64.zip`` for x64 or ``winappcli-arm64.zip`` for ARM64"
189- "2. Extract to your desired location"
190- "3. Add to PATH or run directly: ``winapp.exe``"
191- ""
192- "### NPM Package (for Electron or NodeJS)"
193- "``````bash"
194- "npm install microsoft-winappcli.tgz"
195- "``````"
196- ""
197- "## What's Included"
198- "- MSIX installer packages (x64 and ARM64)"
199- "- Standalone CLI binaries (x64 and ARM64)"
200- "- NPM package for NodeJS/Electron integration"
201- )
202- $installationNotes = $lines -join "`n"
203-
204- $fullBody = "Version: ``$(version)```n"
205- $fullBody += "Commit: ``$(Build.SourceVersion)```n`n"
206- if ($aiNotes) {
207- $fullBody += $aiNotes + "`n`n---`n`n"
208- }
209- $fullBody += $installationNotes
210-
211- $fullBody | Set-Content "$(Pipeline.Workspace)/full-release-notes.md" -Encoding UTF8 -NoNewline
212- Write-Host "Release body written ($($fullBody.Length) chars)"
213-
214223 - ${{ if ne(parameters.GitHubReleaseAlreadyExists, 'true') }} :
215224 - task : GitHubRelease@1
216225 displayName : " Create GitHub Release"
@@ -230,7 +239,7 @@ extends:
230239 assetUploadMode : ' delete'
231240 addChangeLog : false
232241 releaseNotesSource : ' filePath'
233- releaseNotesFilePath : ' $(Pipeline.Workspace)/full-release-notes.md'
242+ releaseNotesFilePath : ' $(Pipeline.Workspace)/release-notes/ full-release-notes.md'
234243
235244 - ${{ if eq(parameters.DoEsrp, 'true') }} :
236245 - stage : Release_Npm
0 commit comments