build #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: build | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| configuration: [Release] | |
| platform: [x64,arm64] | |
| runs-on: windows-2025-vs2026 | |
| env: | |
| Solution_Name: src\ContextMenuBuilder.slnx | |
| Appx_Package_Dir: ${{github.workspace}}\Packages\ | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/checkout@v6 | |
| with: | |
| repository: ikas-mc/ContextMenuBuilderPoc | |
| ref: 'dev' | |
| fetch-depth: 1 | |
| token: ${{ secrets.GH_PAT }} | |
| path: src | |
| lfs: true | |
| - name: Setup MSBuild.exe | |
| uses: microsoft/setup-msbuild@v2 | |
| - name: Update Version Build Number | |
| working-directory: ${{github.workspace}} | |
| run: | | |
| $env:VERSION_BUILD_NUMBER = "${{github.run_number}}" | |
| cd src | |
| .\update-version.ps1 | |
| - name: Restore the application | |
| run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration | |
| env: | |
| Configuration: ${{ matrix.configuration }} | |
| - name: Decode the pfx | |
| run: | | |
| $pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.BASE64_ENCODED_PFX }}") | |
| $certificatePath = "GitHubActionsWorkflow.pfx" | |
| [IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte) | |
| - name: Create the app package | |
| run: msbuild $env:Solution_Name /p:Configuration=$env:Configuration /p:Platform=$env:Platform /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=${{env.CertFile}} /p:PackageCertificatePassword=${{ secrets.Pfx_Key }} /p:AppxPackageDir="$env:Appx_Package_Dir" /p:GenerateAppxPackageOnBuild=true | |
| env: | |
| Appx_Bundle: Never | |
| Appx_Package_Build_Mode: SideloadOnly | |
| Configuration: ${{ matrix.configuration }} | |
| Platform: ${{ matrix.platform }} | |
| CertFile: ${{github.workspace}}\GitHubActionsWorkflow.pfx | |
| - name: Remove the pfx | |
| run: Remove-Item -path GitHubActionsWorkflow.pfx | |
| - name: Upload Deps | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ContextMenuBuilder-Deps-${{ matrix.platform }} | |
| archive: true | |
| path: | | |
| ${{env.Appx_Package_Dir}}\*\Dependencies\${{ matrix.platform }}\* | |
| - name: Upload Package | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ContextMenuBuilder-${{ matrix.platform }}-${{ matrix.configuration }} | |
| archive: true | |
| path: | | |
| ${{env.Appx_Package_Dir}}\*\*.msix | |
| ${{env.Appx_Package_Dir}}\*\*.cer |