.forgejo/workflows/dotnet.yaml aktualisiert
Some checks failed
Dotnet Build / build (push) Has been cancelled
Some checks failed
Dotnet Build / build (push) Has been cancelled
This commit is contained in:
parent
12fbc227a5
commit
025347faf6
1 changed files with 16 additions and 2 deletions
|
@ -16,13 +16,27 @@ jobs:
|
|||
msbuild -version
|
||||
|
||||
- name: Extract project version
|
||||
shell: pwsh
|
||||
run: |
|
||||
$version = Select-String -Path "WeeXnes/WeeXnes.csproj" -Pattern "<Version>(.+?)</Version>" | ForEach-Object {
|
||||
($_ -match "<Version>(.+?)</Version>") | Out-Null
|
||||
$matches[1]
|
||||
}
|
||||
Write-Output "##vso[task.setvariable variable=PROJECT_VERSION]$version"
|
||||
Write-Output "Project version is $version"
|
||||
Write-Output "Version extracted: $version"
|
||||
"PROJECT_VERSION=$version" | Out-File -FilePath $Env:GITHUB_ENV -Encoding ASCII -Append
|
||||
|
||||
|
||||
|
||||
- name: Test exported version variable
|
||||
shell: pwsh
|
||||
run: |
|
||||
Write-Output "The extracted project version is: $env:PROJECT_VERSION"
|
||||
if (-not $env:PROJECT_VERSION) {
|
||||
Write-Error "PROJECT_VERSION variable is not set!"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
- name: Restore Packages
|
||||
|
|
Loading…
Add table
Reference in a new issue