|
| 1 | +name: build packages |
| 2 | +#https://learn.microsoft.com/en-us/windows/apps/package-and-deploy/ci-for-winui3?pivots=winui3-packaged-csharp |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_dispatch: |
| 6 | + |
| 7 | +env: |
| 8 | + BUILD_CONFIGURATION: Release |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + strategy: |
| 13 | + matrix: |
| 14 | + platform: [x64, ARM64] |
| 15 | + package: [CMC_GITHUB_RELEASE, CMC_DEV_RELEASE, CMC_ANY] |
| 16 | + |
| 17 | + runs-on: windows-latest |
| 18 | + |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v4 |
| 21 | + with: |
| 22 | + ref: dev |
| 23 | + |
| 24 | + - name: Add MSBuild to PATH |
| 25 | + uses: microsoft/setup-msbuild@v2 |
| 26 | + |
| 27 | + - name: Decode Cert |
| 28 | + working-directory: ${{env.GITHUB_WORKSPACE}} |
| 29 | + run: | |
| 30 | + $pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.Base64_Encoded_Pfx }}") |
| 31 | + $certificatePath = "${{github.workspace}}\GitHubActionsWorkflow.pfx" |
| 32 | + [IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte) |
| 33 | +
|
| 34 | + - name: Restore NuGet packages |
| 35 | + working-directory: ${{env.GITHUB_WORKSPACE}} |
| 36 | + run: nuget.exe restore ContextMenuCustom -SolutionDirectory ContextMenuCustom |
| 37 | + |
| 38 | + - name: Restore NuGet packages |
| 39 | + working-directory: ${{env.GITHUB_WORKSPACE}} |
| 40 | + run: | |
| 41 | + msbuild -t:restore ContextMenuCustom\ContextMenuCustomApp\ContextMenuCustomApp.csproj |
| 42 | + |
| 43 | + - name: Update Version Build Number |
| 44 | + working-directory: ${{env.GITHUB_WORKSPACE}} |
| 45 | + run: | |
| 46 | + $env:VERSION_BUILD_NUMBER = "${{github.run_number}}" |
| 47 | + .\update-version.ps1 |
| 48 | +
|
| 49 | + - name: Build ContextMenuCustomHost |
| 50 | + working-directory: ${{env.GITHUB_WORKSPACE}} |
| 51 | + run: msbuild ContextMenuCustom\ContextMenuCustomHost\ContextMenuCustomHost.vcxproj /m /p:configuration="release" /p:SolutionDir=../ /p:platform="${{ matrix.platform }}" /p:packageType="${{ matrix.package }}" |
| 52 | + |
| 53 | + - name: Build ContextMenuCustomGithubPackage |
| 54 | + if: matrix.package == 'CMC_GITHUB_RELEASE' |
| 55 | + working-directory: ${{env.GITHUB_WORKSPACE}} |
| 56 | + run: msbuild ContextMenuCustom\ContextMenuCustomGithubPackage\ContextMenuCustomGithubPackage.wapproj /m /p:configuration="release" /p:platform="${{ matrix.platform }}" /p:AppxBundlePlatforms="${{ matrix.platform }}" /p:UapAppxPackageBuildMode=SideloadOnly /p:PackageCertificateKeyFile="${{github.workspace}}\GitHubActionsWorkflow.pfx" /p:PackageCertificatePassword=${{ secrets.Pfx_Key }} /p:AppxPackageDir="${{github.workspace}}\Packages\" |
| 57 | + |
| 58 | + - name: Build ContextMenuCustomDevPackage |
| 59 | + if: matrix.package == 'CMC_DEV_RELEASE' |
| 60 | + working-directory: ${{env.GITHUB_WORKSPACE}} |
| 61 | + run: msbuild ContextMenuCustom\ContextMenuCustomDevPackage\ContextMenuCustomDevPackage.wapproj /m /p:configuration="release" /p:platform="${{ matrix.platform }}" /p:AppxBundlePlatforms="${{ matrix.platform }}" /p:UapAppxPackageBuildMode=SideloadOnly /p:PackageCertificateKeyFile="${{github.workspace}}\GitHubActionsWorkflow.pfx" /p:PackageCertificatePassword=${{ secrets.Pfx_Key }} /p:AppxPackageDir="${{github.workspace}}\Packages\" |
| 62 | + |
| 63 | + - name: Build ContextMenuCustomAnyPackage |
| 64 | + if: matrix.package == 'CMC_ANY' |
| 65 | + working-directory: ${{env.GITHUB_WORKSPACE}} |
| 66 | + run: msbuild ContextMenuCustom\ContextMenuCustomAnyPackage\ContextMenuCustomAnyPackage.wapproj /m /p:configuration="release" /p:platform="${{ matrix.platform }}" /p:AppxBundlePlatforms="${{ matrix.platform }}" /p:UapAppxPackageBuildMode=SideloadOnly /p:PackageCertificateKeyFile="${{github.workspace}}\GitHubActionsWorkflow.pfx" /p:PackageCertificatePassword=${{ secrets.Pfx_Key }} /p:AppxPackageDir="${{github.workspace}}\Packages\" |
| 67 | + |
| 68 | + - name: Remove Cert |
| 69 | + run: Remove-Item -path "${{github.workspace}}\GitHubActionsWorkflow.pfx" |
| 70 | + |
| 71 | + - name: Upload Packages |
| 72 | + uses: actions/upload-artifact@v4 |
| 73 | + with: |
| 74 | + name: ContextMenuCustom-${{ matrix.package }}-${{ matrix.platform }} |
| 75 | + path: | |
| 76 | + ${{github.workspace}}\Packages\**\*.msixbundle |
| 77 | + ${{github.workspace}}\Packages\**\*.msix |
| 78 | + ${{github.workspace}}\Packages\**\*.cer |
| 79 | + ${{github.workspace}}\Packages\**\Dependencies\${{ matrix.platform }}\* |
0 commit comments