47 lines
No EOL
1.2 KiB
YAML
47 lines
No EOL
1.2 KiB
YAML
name: Dotnet Build
|
|
|
|
on: [push]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: win11
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
- name: MSBuild version
|
|
run: |
|
|
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 "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
|
|
run: nuget restore WeeXnes.sln
|
|
|
|
- name: Build Solution
|
|
run: |
|
|
msbuild WeeXnes.sln /p:DeleteExistingFiles=True /p:platform="Any CPU" /p:configuration="Release" |