@@ -191,7 +191,7 @@ jobs:
191
191
run : |
192
192
git config --local user.email "github-actions[bot]@users.noreply.github.com"
193
193
git config --local user.name "github-actions[bot]"
194
- git commit -m "Update Wiki with icon changes for ${{ inputs.milestone }}" --all
194
+ git commit -m "[automated] Update Wiki with icon changes for ${{ inputs.milestone }}" --all
195
195
git push
196
196
197
197
push_nugets :
@@ -235,3 +235,44 @@ jobs:
235
235
$milestones = $(gh milestone list --json number,title) | ConvertFrom-Json
236
236
$milestoneNumber = ($milestones | Where-Object { $_.title -eq "${{ inputs.milestone }}" }).number
237
237
gh milestone edit $milestoneNumber --state closed
238
+
239
+ update_version_numbers :
240
+ needs : [create_release]
241
+ runs-on : ubuntu-latest
242
+ name : Update Version Numbers
243
+ environment : production
244
+
245
+ steps :
246
+ - name : Increment Version Numbers
247
+ run : |
248
+ function Update-Version {
249
+ param (
250
+ [string]$Prefix
251
+ )
252
+ $workflowPath = "./.github/workflows/get_versions.yml"
253
+ $workflowContent = Get-Content -Path $workflowPath
254
+
255
+ $versionPattern = '"(\d+\.\d+\.)(\d+)"'
256
+ $pattern = "$Prefix`: $versionPattern"
257
+ $match = $workflowContent -match $pattern
258
+
259
+ if ($match[0] -match $versionPattern) {
260
+ $newVersion = $Matches[1] + ([int]$Matches[2] + 1)
261
+ $workflowContent = $workflowContent -replace $pattern,"$Prefix`: `"$newVersion`""
262
+ } else {
263
+ Write-Error "Failed to update $Prefix version"
264
+ }
265
+
266
+ Set-Content -Path $workflowPath -Value $workflowContent
267
+ }
268
+
269
+ Update-Version -Prefix "mdix-version"
270
+ Update-Version -Prefix "mdix-colors-version"
271
+ Update-Version -Prefix "mdix-mahapps-version"
272
+
273
+ - name : Push Changes
274
+ run : |
275
+ git config --local user.email "github-actions[bot]@users.noreply.github.com"
276
+ git config --local user.name "github-actions[bot]"
277
+ git commit -m "[automated] Increment version numbers after release of ${{ inputs.milestone }}" --all
278
+ git push
0 commit comments