feat: Update Windows target #477
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
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| types: [ "review_requested", "ready_for_review" ] | |
| workflow_dispatch: | |
| name: Windows | |
| permissions: | |
| id-token: write | |
| contents: read | |
| env: | |
| PROJECT_NAME: Nickvision.Application.WinUI | |
| INSTALLER_NAME: NickvisionApplicationSetup | |
| SHORT_NAME: Application | |
| jobs: | |
| winui-windows: | |
| name: "WinUI on Windows" | |
| if: ${{ github.event.pull_request.user.login != 'weblate' }} | |
| strategy: | |
| matrix: | |
| variant: | |
| - arch: x64 | |
| runner: windows-2025-vs2026 | |
| subsys: mingw64 | |
| type: x86_64 | |
| - arch: arm64 | |
| runner: windows-11-arm | |
| subsys: clangarm64 | |
| type: clang-aarch64 | |
| runs-on: ${{ matrix.variant.runner }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - uses: msys2/setup-msys2@v2 | |
| id: msys2 | |
| with: | |
| msystem: ${{ matrix.variant.subsys }} | |
| install: mingw-w64-${{ matrix.variant.type }}-gettext-tools | |
| - uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: '10.0.x' | |
| - name: "Setup Environment" | |
| shell: pwsh | |
| run: echo "${{ steps.msys2.outputs.msys2-location }}\${{ matrix.variant.subsys }}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| - name: "Restore" | |
| run: dotnet restore ${{ env.PROJECT_NAME }} --runtime win-${{ matrix.variant.arch }} /p:PublishReadyToRun=true | |
| - name: "Publish" | |
| run: dotnet publish ${{ env.PROJECT_NAME }} -c Release --no-restore --runtime win-${{ matrix.variant.arch }} /p:Platform=${{ matrix.variant.arch }} | |
| - name: "Installer" | |
| working-directory: ${{github.workspace}}/inno | |
| env: | |
| APP_FILES_PATH: ${{ env.PROJECT_NAME }}/bin/${{ matrix.variant.arch }}/Release/net10.0-windows10.0.22621.0/win-${{ matrix.variant.arch }}/publish | |
| shell: pwsh | |
| run: | | |
| $ProgressPreference = 'SilentlyContinue' | |
| iscc setup.iss | |
| - name: "Portable" | |
| shell: pwsh | |
| run: | | |
| $publishDir = "${{ env.PROJECT_NAME }}\bin\${{ matrix.variant.arch }}\Release\net10.0-windows10.0.22621.0\win-${{ matrix.variant.arch }}\publish" | |
| $portableDir = "${{ github.workspace }}\portable" | |
| New-Item -ItemType Directory -Force -Path "$portableDir\Release" | Out-Null | |
| Copy-Item -Path "$publishDir\*" -Destination "$portableDir\Release" -Recurse | |
| $batContent = "@echo off`r`n`"%~dp0Release\${{ env.PROJECT_NAME }}.exe`" --portable" | |
| Set-Content -Path "$portableDir\${{ env.SHORT_NAME }}.bat" -Value $batContent -NoNewline | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| path: ${{ github.workspace }}/inno/${{ env.INSTALLER_NAME }}.exe | |
| name: ${{ env.INSTALLER_NAME }}-${{ matrix.variant.arch }} | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| path: ${{ github.workspace }}/portable | |
| name: ${{ env.PROJECT_NAME }}-portable-${{ matrix.variant.arch }} |