Merge pull request #6 from hu-ja-ja/pr-bundle #12
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: CI | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| release: | |
| types: [ published ] | |
| workflow_dispatch: | |
| inputs: | |
| runtime: | |
| description: 'RuntimeIdentifier for packaging (used only for manual runs)' | |
| required: false | |
| default: 'win-x64' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-test: | |
| 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 | |
| working-directory: src | |
| - name: Build | |
| run: dotnet build --no-restore --configuration Release | |
| working-directory: src | |
| - name: Test | |
| run: dotnet test --no-build --configuration Release --verbosity normal | |
| working-directory: src | |
| - name: Package (manual / release) | |
| if: github.event_name == 'workflow_dispatch' || github.event_name == 'release' | |
| shell: pwsh | |
| env: | |
| PACKAGE_RUNTIME: ${{ github.event_name == 'workflow_dispatch' && inputs.runtime || 'win-x64' }} | |
| run: .\scripts\package.ps1 -Configuration Release -Runtime $env:PACKAGE_RUNTIME | |
| - name: Upload package artifact (manual only) | |
| if: github.event_name == 'workflow_dispatch' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: WindowController-Release-${{ inputs.runtime }} | |
| path: dist/*.zip | |
| - name: Upload zip to GitHub Release assets (release only) | |
| if: github.event_name == 'release' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: dist/*.zip |