Update dotnet.yml #54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| pull_request: | |
| branches: [ "master" ] | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build --configuration Release /nowarn:CS8618;CS8600;CS8601;CS8602;CS8603;CS8604;CS8620;CS1998 | |
| - name: Publish | |
| run: dotnet publish --configuration Release /nowarn:CS8618;CS8600;CS8601;CS8602;CS8603;CS8604;CS8620;CS1998 --output ./publish | |
| - name: Zip artifact | |
| run: | | |
| mkdir zip | |
| $zipFilename = "build-artifact.zip" | |
| Compress-Archive -Path ./publish -DestinationPath "./zip/$zipFilename" -Force | |
| shell: powershell | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-artifact | |
| path: ./zip/build-artifact.zip |