diff --git a/.forgejo/workflows/dotnet.yaml b/.forgejo/workflows/dotnet.yaml
index 001dfe5..d1720f4 100644
--- a/.forgejo/workflows/dotnet.yaml
+++ b/.forgejo/workflows/dotnet.yaml
@@ -16,13 +16,27 @@ jobs:
msbuild -version
- name: Extract project version
+ shell: pwsh
run: |
$version = Select-String -Path "WeeXnes/WeeXnes.csproj" -Pattern "(.+?)" | ForEach-Object {
($_ -match "(.+?)") | 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