Skip to content

Commit a854b66

Browse files
authored
Bump version numbers post release
1 parent aff9f5a commit a854b66

File tree

1 file changed

+42
-1
lines changed

1 file changed

+42
-1
lines changed

.github/workflows/release.yml

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ jobs:
191191
run: |
192192
git config --local user.email "github-actions[bot]@users.noreply.github.com"
193193
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
195195
git push
196196
197197
push_nugets:
@@ -235,3 +235,44 @@ jobs:
235235
$milestones = $(gh milestone list --json number,title) | ConvertFrom-Json
236236
$milestoneNumber = ($milestones | Where-Object { $_.title -eq "${{ inputs.milestone }}" }).number
237237
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

Comments
 (0)