try to fix action... #67
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
| # This workflow will build a .NET project | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
| name: .NET | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - 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 --no-restore | |
| - name: Test | |
| run: dotnet test --no-build --verbosity normal --blame-hang-timeout 5min | |
| # copy the HTML report to a guaranteed path | |
| - name: Locate test report | |
| shell: pwsh | |
| run: | | |
| $report = Get-ChildItem -Recurse -Filter MiloLib_RoundTrip_TestReport.html | Select-Object -First 1 | |
| if (-not $report) { | |
| Write-Error "MiloLib_RoundTrip_TestReport.html not found" | |
| exit 1 | |
| } | |
| Copy-Item $report.FullName -Destination MiloLib_RoundTrip_TestReport.html -Force | |
| - name: Publish | |
| run: dotnet publish -c Release -o publish | |
| - name: Create Zip Archive | |
| run: | | |
| Compress-Archive -Path publish/* -DestinationPath MiloEditor.zip | |
| - name: Create Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: continuous-${{ github.run_number }} | |
| release_name: Continuous Build ${{ github.run_number }} | |
| body: | | |
| Build automatically generated from commit ${{ github.sha }}. This build may have bugs and/or corrupt Milo scenes - use with caution. | |
| draft: false | |
| prerelease: true | |
| - name: Upload Test Report to Release | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: MiloLib_RoundTrip_TestReport.html | |
| asset_name: MiloLib_RoundTrip_TestReport.html | |
| asset_content_type: text/html | |
| - name: Upload Release Asset | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: MiloEditor.zip | |
| asset_name: MiloEditor.zip | |
| asset_content_type: application/zip |