Skip to content

Commit

Permalink
Adding version check
Browse files Browse the repository at this point in the history
Updating versions.
  • Loading branch information
Keboo authored May 11, 2023
1 parent 53ceabd commit b410058
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/get_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:
getting_versions:
env:
#Update these base version numbers
mdix-version: "4.8.1"
mdix-colors-version: "2.1.3"
mdix-mahapps-version: "0.2.9"
mdix-version: "4.9.0"
mdix-colors-version: "2.1.4"
mdix-mahapps-version: "0.3.0"
name: Set version numbers
runs-on: ubuntu-latest
defaults:
Expand Down
20 changes: 19 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,21 @@ jobs:
uses: ./.github/workflows/get_versions.yml
with:
is-full-release: true


version_number_check:
needs: [get_versions]
name: Version matches milestone

steps:
- name: Check versions
run: |
if ('${{ inputs.milestone }}' -ne '${{ needs.get_versions.outputs.mdix-version }}') {
Write-Error "Milestone ${{ inputs.milestone }} does not match MDIX ${{ needs.get_versions.outputs.mdix-version }}"
exit 1
} else {
Write-Host "Versions match"
}
build_release_notes:
runs-on: ubuntu-latest
name: Generate Release Notes
Expand Down Expand Up @@ -246,6 +260,9 @@ jobs:
name: Update Version Numbers
environment: production

permissions:
actions: write

steps:
# Checkout is needed so that we can update the get_versions.yml file
- uses: actions/checkout@v3
Expand All @@ -266,6 +283,7 @@ jobs:
if ($match[0] -match $versionPattern) {
$newVersion = $Matches[1] + ([int]$Matches[2] + 1)
$workflowContent = $workflowContent -replace $pattern,"$Prefix`: `"$newVersion`""
Write-Host "$Prefix updated to $newVersion"
} else {
Write-Error "Failed to update $Prefix version"
}
Expand Down

0 comments on commit b410058

Please sign in to comment.