[VERSION] 1.2.1-beta #4
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 and Publish | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| Build: | |
| permissions: | |
| contents: read | |
| strategy: | |
| matrix: | |
| os: [windows-latest, windows-11-arm] | |
| platform: [x64, x86, ARM64, ARM64EC] | |
| config: [Debug, Release] | |
| fail-fast: false | |
| runs-on: ${{matrix.os}} | |
| steps: | |
| - name: Source checkout | |
| uses: actions/checkout@main | |
| with: | |
| submodules: recursive | |
| - name: Prepare MSBuild | |
| uses: microsoft/setup-msbuild@main | |
| - name: Build | |
| run: msbuild .\Source\KNSoft.SlimDetours.sln /restore /m /p:Configuration=${{matrix.config}} /p:Platform=${{matrix.platform}} /p:RestorePackagesConfig=true | |
| - name: Run Unit Test | |
| if: ${{(matrix.os == 'windows-latest' && (matrix.platform == 'x64' || matrix.platform == 'x86') || matrix.os == 'windows-11-arm')}} | |
| run: | | |
| .\Source\OutDir\${{matrix.platform}}\${{matrix.config}}\Demo.exe -Run | |
| .\Source\OutDir\${{matrix.platform}}\${{matrix.config}}\Demo.exe -Run DeadLock -Engine=SlimDetours | |
| - name: Build [NT5, x64/x86] | |
| if: ${{ matrix.platform == 'x64' || matrix.platform == 'x86' }} | |
| run: | | |
| set CL=/D_WIN32_WINNT=0x0500 | |
| msbuild .\Source\KNSoft.SlimDetours.sln /restore /m /p:Configuration=${{matrix.config}} /p:Platform=${{matrix.platform}} /p:RestorePackagesConfig=true | |
| - name: Run Unit Test [NT5, x64/x86] | |
| if: ${{ matrix.platform == 'x64' || matrix.platform == 'x86' }} | |
| run: | | |
| .\Source\OutDir\${{matrix.platform}}\${{matrix.config}}\Demo.exe -Run | |
| .\Source\OutDir\${{matrix.platform}}\${{matrix.config}}\Demo.exe -Run DeadLock -Engine=SlimDetours | |
| Publish: | |
| if: ${{github.base_ref == '' && startsWith(github.event.head_commit.message, '[VERSION] ')}} | |
| needs: Build | |
| permissions: | |
| contents: write | |
| runs-on: windows-latest | |
| steps: | |
| - name: Set release version | |
| id: relver | |
| shell: pwsh | |
| run: | | |
| $relver="${{github.event.head_commit.message}}".Substring(10) | |
| Write-Output "relver=$relver">>$env:GITHUB_OUTPUT | |
| - name: Source checkout | |
| uses: actions/checkout@main | |
| with: | |
| submodules: recursive | |
| - name: Prepare MSBuild | |
| uses: microsoft/setup-msbuild@main | |
| - name: Build | |
| run: | | |
| msbuild .\Source\KNSoft.SlimDetours.sln /restore /m /p:Configuration=Release /p:Platform=x64 /p:RestorePackagesConfig=true | |
| msbuild .\Source\KNSoft.SlimDetours.sln /restore /m /p:Configuration=Release /p:Platform=x86 /p:RestorePackagesConfig=true | |
| msbuild .\Source\KNSoft.SlimDetours.sln /restore /m /p:Configuration=Release /p:Platform=ARM64 /p:RestorePackagesConfig=true | |
| msbuild .\Source\KNSoft.SlimDetours.sln /restore /m /p:Configuration=Release /p:Platform=ARM64EC /p:RestorePackagesConfig=true | |
| msbuild .\Source\KNSoft.SlimDetours.sln /restore /m /p:Configuration=Debug /p:Platform=x64 /p:RestorePackagesConfig=true | |
| msbuild .\Source\KNSoft.SlimDetours.sln /restore /m /p:Configuration=Debug /p:Platform=x86 /p:RestorePackagesConfig=true | |
| msbuild .\Source\KNSoft.SlimDetours.sln /restore /m /p:Configuration=Debug /p:Platform=ARM64 /p:RestorePackagesConfig=true | |
| msbuild .\Source\KNSoft.SlimDetours.sln /restore /m /p:Configuration=Debug /p:Platform=ARM64EC /p:RestorePackagesConfig=true | |
| - name: Run Unit Test | |
| run: | | |
| .\Source\OutDir\x64\Release\Demo.exe -Run | |
| .\Source\OutDir\x64\Release\Demo.exe -Run DeadLock -Engine=SlimDetours | |
| .\Source\OutDir\x86\Release\Demo.exe -Run | |
| .\Source\OutDir\x86\Release\Demo.exe -Run DeadLock -Engine=SlimDetours | |
| .\Source\OutDir\x64\Debug\Demo.exe -Run | |
| .\Source\OutDir\x64\Debug\Demo.exe -Run DeadLock -Engine=SlimDetours | |
| .\Source\OutDir\x86\Debug\Demo.exe -Run | |
| .\Source\OutDir\x86\Debug\Demo.exe -Run DeadLock -Engine=SlimDetours | |
| - name: Create NuGet package | |
| run: | | |
| cd .\Source | |
| nuget pack | |
| - name: Create release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: v${{steps.relver.outputs.relver}} | |
| tag_name: v${{steps.relver.outputs.relver}} | |
| body: "(TO BE FILLED BY MAINTAINER)\n**NuGet Package**: https://www.nuget.org/packages/KNSoft.SlimDetours/${{steps.relver.outputs.relver}}" | |
| prerelease: true | |
| preserve_order: true | |
| fail_on_unmatched_files: true | |
| generate_release_notes: true | |
| files: ./Source/KNSoft.SlimDetours.${{steps.relver.outputs.relver}}.nupkg |