feat: Patch Collision to pass check results through reference #23
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 CI/CD | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| jobs: | |
| build-and-release: | |
| runs-on: windows-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET SDK | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '9.0.x' | |
| - name: Install GitVersion | |
| uses: gittools/actions/gitversion/setup@v1 | |
| with: | |
| versionSpec: '5.x' | |
| - name: Run GitVersion | |
| id: gitversion | |
| uses: gittools/actions/gitversion/execute@v1 | |
| - name: Restore dependencies | |
| run: dotnet restore src/OTAPI.UnifiedServerProcess/OTAPI.UnifiedServerProcess.csproj | |
| - name: Build project with version | |
| run: > | |
| dotnet build src/OTAPI.UnifiedServerProcess/OTAPI.UnifiedServerProcess.csproj | |
| --configuration Release | |
| /p:GitVersion_NuGetVersion=${{ steps.gitversion.outputs.nuGetVersionV2 }} | |
| /p:GitVersion_AssemblySemVer=${{ steps.gitversion.outputs.assemblySemVer }} | |
| /p:GitVersion_AssemblySemFileVer=${{ steps.gitversion.outputs.assemblySemFileVer }} | |
| /p:GitVersion_InformationalVersion=${{ steps.gitversion.outputs.informationalVersion }} | |
| - name: Run compiled EXE | |
| run: | | |
| cd src/OTAPI.UnifiedServerProcess/bin/Release/net9.0 | |
| .\OTAPI.UnifiedServerProcess.exe | |
| - name: Create output zip file | |
| run: | | |
| $version = "${{ steps.gitversion.outputs.nuGetVersionV2 }}" | |
| $outputDir = "src/OTAPI.UnifiedServerProcess/bin/Release/net9.0/output" | |
| $zipPath = "UnifiedServerProcess-v$version.zip" | |
| Compress-Archive -Path "$outputDir\*" -DestinationPath "$zipPath" | |
| echo "Created zip at $zipPath" | |
| - name: Create Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: v${{ steps.gitversion.outputs.nuGetVersionV2 }} | |
| release_name: Release v${{ steps.gitversion.outputs.nuGetVersionV2 }} | |
| draft: false | |
| prerelease: false | |
| - 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: ./UnifiedServerProcess-v${{ steps.gitversion.outputs.nuGetVersionV2 }}.zip | |
| asset_name: UnifiedServerProcess-v${{ steps.gitversion.outputs.nuGetVersionV2 }}.zip | |
| asset_content_type: application/zip |