Skip to content

Commit d3209f4

Browse files
committed
add
1 parent 2c9b2d1 commit d3209f4

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

.github/workflows/build.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,40 @@ on:
44
- eliaspr/build-workflow-update
55

66
jobs:
7+
validate-version:
8+
name: 'Validate version'
9+
runs-on: ubuntu-24.04
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: 'Extract and validate turnierplan.NET version'
13+
id: extract-version
14+
shell: pwsh
15+
run: |
16+
$LatestTag = git describe --tags --abbrev=0 --match=[0-9]*.[0-9]*.[0-9]*
17+
$VersionXmlContent = Get-Content -Path "version.xml" -Raw
18+
$Version = [regex]::Match($VersionXmlContent, '<Version>(\d+\.\d+\.\d+)</Version>').Groups[1].Value
19+
Write-Host "Last git tag: $LatestTag"
20+
Write-Host "Detected version: $Version"
21+
if ($Version -eq $LatestTag) {
22+
Write-Host "Version equals latest tag, failing workflow!"
23+
exit 1
24+
}
25+
Add-Content -Path $env:GITHUB_OUTPUT -Value "turnierplan_version=$Version"
26+
working-directory: './src'
27+
outputs:
28+
turnierplan_version: ${{ steps.extract-version.outputs.turnierplan_version }}
29+
730
container-image:
831
name: 'Build container image'
932
runs-on: ubuntu-24.04
33+
needs:
34+
- validate-version
1035
steps:
1136
- uses: actions/checkout@v2
37+
- name: 'Test'
38+
shell: pwsh
39+
run: |
40+
Write-Host ${{ needs.validate-version.outputs.turnierplan_version }}
1241
# - name: 'Extract turnierplan.NET version'
1342
# shell: pwsh
1443
# run: |
@@ -39,6 +68,8 @@ jobs:
3968
nuget-package:
4069
name: 'Build NuGet package'
4170
runs-on: ubuntu-24.04
71+
needs:
72+
- validate-version
4273
steps:
4374
- uses: actions/checkout@v2
4475
# - name: 'Setup .NET SDK 9.x'

0 commit comments

Comments
 (0)