Bump version and fix CI action (#654) #10
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 Package MSIX | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - master | |
| paths: | |
| - 'FluentFlyoutMSIX/Package.appxmanifest' | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| configuration: ["GitHub Release", "Release"] | |
| env: | |
| SOLUTION_PATH: FluentFlyout.sln | |
| WAP_PROJECT_PATH: FluentFlyoutMSIX\FluentFlyoutMSIX.wapproj | |
| CONFIGURATION: ${{ matrix.configuration }} | |
| PLATFORM: x64 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup MSBuild | |
| uses: microsoft/setup-msbuild@v3 | |
| - name: Decode signing certificate | |
| run: | | |
| $cert = [Convert]::FromBase64String("${{ secrets.MSIX_CERT_BASE64 }}") | |
| [IO.File]::WriteAllBytes("$env:RUNNER_TEMP\cert.pfx", $cert) | |
| - name: Restore NuGet packages | |
| run: nuget restore $env:SOLUTION_PATH | |
| - name: Extract app version | |
| run: | | |
| [xml]$manifest = Get-Content 'FluentFlyoutMSIX\Package.appxmanifest' | |
| $fullVersion = $manifest.Package.Identity.Version | |
| $version = ($fullVersion -split '\.')[0..2] -join '.' | |
| echo "APP_VERSION=$version" >> $env:GITHUB_ENV | |
| - name: Build & Package (MSIX) | |
| run: | | |
| msbuild $env:WAP_PROJECT_PATH ` | |
| /p:Configuration=$env:CONFIGURATION ` | |
| /p:Platform=$env:PLATFORM ` | |
| /p:UapAppxPackageBuildMode=StoreUpload ` | |
| /p:AppxPackageDir="$env:GITHUB_WORKSPACE\AppxPackages\\" ` | |
| /p:AppxPackageSigningEnabled=false ` | |
| - name: Prepare installer structure | |
| run: | | |
| $outDir = "$env:GITHUB_WORKSPACE\InstallerOutput" | |
| New-Item -ItemType Directory -Path $outDir | Out-Null | |
| $testFolder = Get-ChildItem "$env:GITHUB_WORKSPACE\AppxPackages" -Directory | | |
| Where-Object { $_.Name -like '*_Test' } | Select-Object -First 1 | |
| Move-Item $testFolder.FullName "$outDir\SystemFiles" | |
| Copy-Item ".github\build-files\FluentFlyout_Installer.bat" "$outDir\" | |
| Copy-Item ".github\build-files\README.txt" "$outDir\" | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: FluentFlyout_${{ env.APP_VERSION }}_${{ env.PLATFORM }}_${{ matrix.configuration == 'GitHub Release' && 'Installer' || 'Release' }} | |
| path: InstallerOutput\ |