[github/workflows/build] Enable PublishSingleFile #122
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: .NET Core Desktop | |
| on: | |
| push: | |
| branches: [ "main", "develop", "reborn" ] | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| configuration: [ Debug, Release ] | |
| projectName: [ XeniaBot.Core, XeniaBot.WebPanel ] | |
| runtime: [ win-x64, linux-x64 ] | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| # Install the .NET Core workload | |
| - name: Install .NET Core | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 8.0.x | |
| 9.0.x | |
| - run: dotnet tool install -g dotnet-t4 | |
| - name: Clean | |
| run: dotnet clean ./XeniaBot.sln --configuration ${{ matrix.configuration }} && dotnet nuget locals all --clear | |
| - name: Publish Windows | |
| run: | | |
| dotnet publish ${{ matrix.projectName }} --self-contained true -c ${{ matrix.configuration }} --runtime ${{ matrix.runtime }} -p:PublishSingleFile=true | |
| Compress-Archive -Path ./${{ matrix.projectName }}/bin/${{ matrix.configuration }}/net8.0/${{ matrix.runtime }}/publish/* -Destination ${{ matrix.projectName }}.zip | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.projectName }} (${{ matrix.configuration }}, ${{ matrix.runtime }}) | |
| path: | | |
| ./${{ matrix.projectName }}.zip | |