Skip to content

Commit b85cc3b

Browse files
committed
Add versioning evaluation job
1 parent 0a311e4 commit b85cc3b

2 files changed

Lines changed: 38 additions & 24 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 37 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,31 @@ env:
1818
MEDIA_PROJECT_PATH: '${{ github.workspace }}\src\core\Riverside.MediaRecording\Riverside.MediaRecording.csproj'
1919

2020
jobs:
21+
evaluate:
22+
runs-on: windows-2025-vs2026
23+
outputs:
24+
version_bumped: ${{ steps.detect.outputs.version_props_changed }}
25+
steps:
26+
- uses: actions/checkout@v6
27+
with:
28+
fetch-depth: 0
29+
30+
- name: Detect versioning bump
31+
id: detect
32+
shell: pwsh
33+
run: |
34+
$before = "${{ github.event.before }}"
35+
$after = "${{ github.sha }}"
36+
37+
if ($before -match '^0+$') {
38+
$changed = git show --name-only --pretty="" $after | Select-String -SimpleMatch "eng/CurrentVersion.props"
39+
} else {
40+
$changed = git diff --name-only $before $after | Select-String -SimpleMatch "eng/CurrentVersion.props"
41+
}
42+
43+
$flag = if ($changed) { "true" } else { "false" }
44+
"version_props_changed=$flag" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
45+
2146
formatting:
2247
runs-on: windows-2025-vs2026
2348

@@ -318,13 +343,10 @@ jobs:
318343

319344
publish-releases:
320345
if: |
321-
github.event_name == 'push' &&
322-
github.ref == 'refs/heads/main' &&
323-
contains(
324-
join(github.event.head_commit.modified, ','),
325-
'eng/CurrentVersion.props'
326-
)
327-
needs: [app, cli, api, tus, media]
346+
github.event_name == 'push' &&
347+
github.ref == 'refs/heads/main' &&
348+
needs.evaluate.outputs.version_bumped == 'true'
349+
needs: [evaluate, app, cli, api, tus, media]
328350
runs-on: windows-latest
329351
environment:
330352
name: GitHub Releases
@@ -342,8 +364,6 @@ jobs:
342364
id: mode
343365
shell: pwsh
344366
run: |
345-
$before = "${{ github.event.before }}"
346-
$after = "${{ github.sha }}"
347367
$versionPropsPath = Join-Path $env:GITHUB_WORKSPACE 'eng\CurrentVersion.props'
348368
349369
[xml]$versionProps = Get-Content $versionPropsPath
@@ -384,13 +404,10 @@ jobs:
384404
385405
publish-nuget:
386406
if: |
387-
github.event_name == 'push' &&
388-
github.ref == 'refs/heads/main' &&
389-
contains(
390-
join(github.event.head_commit.modified, ','),
391-
'eng/CurrentVersion.props'
392-
)
393-
needs: [cli, api, tus, media]
407+
github.event_name == 'push' &&
408+
github.ref == 'refs/heads/main' &&
409+
needs.evaluate.outputs.version_bumped == 'true'
410+
needs: [evaluate, cli, api, tus, media]
394411
runs-on: windows-latest
395412
strategy:
396413
fail-fast: false
@@ -442,13 +459,10 @@ jobs:
442459
443460
publish-web:
444461
if: |
445-
github.event_name == 'push' &&
446-
github.ref == 'refs/heads/main' &&
447-
contains(
448-
join(github.event.head_commit.modified, ','),
449-
'eng/CurrentVersion.props'
450-
)
451-
needs: [app]
462+
github.event_name == 'push' &&
463+
github.ref == 'refs/heads/main' &&
464+
needs.evaluate.outputs.version_bumped == 'true'
465+
needs: [evaluate, app]
452466
runs-on: windows-latest
453467
environment:
454468
name: Web

‎eng/CurrentVersion.props‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ GUIDE TO VERSIONING PRACTICES:
1616
<MajorVersion>0</MajorVersion>
1717
<MinorVersion>3</MinorVersion>
1818
<ReleaseLevel>final</ReleaseLevel>
19-
<BetaVersion Condition="'$(ReleaseLevel)' != 'final'">1</BetaVersion>
19+
<BetaVersion Condition="'$(ReleaseLevel)' != 'final'">0</BetaVersion>
2020
</PropertyGroup>
2121
</Project>

0 commit comments

Comments
 (0)