Add GitHub Actions build and release workflows #1
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: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| configuration: [Debug, Release] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: "10.0.x" | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build ${{ matrix.configuration }} | |
| run: dotnet build --configuration ${{ matrix.configuration }} --no-restore | |
| - name: Publish ${{ matrix.configuration }} (Self-contained) | |
| if: matrix.configuration == 'Release' | |
| run: dotnet publish --configuration ${{ matrix.configuration }} --runtime win-x64 --self-contained true --output ./publish/${{ matrix.configuration }} | |
| - name: Upload ${{ matrix.configuration }} Artifacts | |
| if: matrix.configuration == 'Release' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: MCP-UAsset-Toolkit-${{ matrix.configuration }}-win-x64 | |
| path: ./publish/${{ matrix.configuration }} | |
| retention-days: 30 | |
| - name: List build output | |
| run: | | |
| Write-Host "Build completed for ${{ matrix.configuration }}" | |
| if (Test-Path "bin/${{ matrix.configuration }}/net10.0/win-x64") { | |
| Get-ChildItem -Path "bin/${{ matrix.configuration }}/net10.0/win-x64" -Recurse | Select-Object FullName, Length | |
| } |