# This workflow will build and publish a .NET project name: .NET on: push: branches: [ "main" ] pull_request: branches: [ "main" ] jobs: build: runs-on: windows-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Setup .NET uses: actions/setup-dotnet@v4 with: dotnet-version: 8.0.x - name: Restore dependencies run: dotnet restore - name: Build run: dotnet build src/VHDPatchFix/VHDPatchFix.csproj --no-restore --configuration Release - name: Test run: dotnet test --no-build --configuration Release --verbosity normal - name: Publish run: dotnet publish src/VHDPatchFix/VHDPatchFix.csproj --configuration Release --runtime win-x64 --self-contained true --property PublishSingleFile=true --output ./publish - name: Upload artifact uses: actions/upload-artifact@v4 with: name: VHDPatchFix-win-x64 path: ./publish if-no-files-found: error