From 805109d9ddf6782630897f3d28dc4adc7032d0d9 Mon Sep 17 00:00:00 2001 From: Stern <70122891+SternXD@users.noreply.github.com> Date: Sat, 27 Jul 2024 23:10:12 -0400 Subject: [PATCH] (ci:) winrt workflow --- .github/workflows/winrt.yml | 103 ++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 58 deletions(-) diff --git a/.github/workflows/winrt.yml b/.github/workflows/winrt.yml index bd8b5b706667a..264e9a78c92b0 100644 --- a/.github/workflows/winrt.yml +++ b/.github/workflows/winrt.yml @@ -1,69 +1,56 @@ -name: Windows UWP Builds - +name: Build UWP Package on: push: branches: - - '*' + - uwp pull_request: branches: - uwp jobs: - # MSBUILD - lint_vs_proj_files: - name: Lint VS Project Files - runs-on: windows-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - name: Verify VS Project Files - run: .github\workflows\scripts\windows\validate-vs-filters.ps1 - - winrt-build-avx2: - name: Building WinRT (AVX2) - needs: lint_vs_proj_files + build: runs-on: windows-latest steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Generate Self-Signed Certificate - id: cert - run: | - New-SelfSignedCertificate -CertStoreLocation "Cert:\CurrentUser\My" -Subject "CN=MyUWPCert" -KeyAlgorithm RSA -KeyLength 2048 -Provider "Microsoft Enhanced RSA and AES Cryptographic Provider" -KeyExportPolicy Exportable -NotAfter (Get-Date).AddYears(1) - $thumbprint = (Get-ChildItem -Path Cert:\CurrentUser\My | Where-Object { $_.Subject -eq "CN=MyUWPCert" }).Thumbprint - Write-Output "::set-output name=thumbprint::$thumbprint" - shell: pwsh - - - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v2 - - - name: Setup NuGet.exe - uses: NuGet/setup-nuget@v2 - with: - nuget-version: latest - - - name: Download Patches - shell: cmd - run: | - cd bin/resources - aria2c -Z "https://github.com/PCSX2/pcsx2_patches/releases/tag/latest/download/patches.zip" - - - name: Download Dependencies - shell: cmd - run: | - aria2c -Z "https://github.com/PCSX2/pcsx2-windows-dependencies/releases/download/latest-windows-dependencies/pcsx2-windows-dependencies.7z" - - - name: Extract some files - run: 7z x pcsx2-windows-dependencies.7z -o"./" - - - name: Build project - run: | - msbuild PCSX2_qt.sln /m /p:PlatformToolset=v143 /p:Platform=x64 /p:Configuration="Release AVX2" /p:AppxPackageSigningEnabled=true /p:PackageCertificateThumbprint="${{ steps.cert.outputs.thumbprint }}" /t:restore,build /p:RestorePackagesConfig=true - - - name: Upload Builds - uses: actions/upload-artifact@v4 - with: - name: XBSX2.0 Nightly Build (AVX2) - path: AppPackages/xbsx2/ + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up MSBuild + uses: microsoft/setup-msbuild@v2 + + - name: Set up NuGet + uses: NuGet/setup-nuget@v2 + + - name: Extract version string from AppxManifest + id: extract_version + run: | + $manifest = [xml](Get-Content pcsx2-winrt\Package.appxmanifest) + $version = $manifest.Package.Identity.Version + echo $version + echo version=$version >> $env:GITHUB_OUTPUT + + - name: Echo the GitHub Env for File Names + run: | + echo "${{ steps.extract_version.outputs.version }}" + + - name: Restore NuGet packages + run: nuget restore PCSX2_qt.sln + + - name: Build the project + run: msbuild PCSX2_qt.sln /t:Restore,Rebuild /p:Configuration=Release /p:Platform=x64 + + - name: Build APPX + run: | + & 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.22621.0/x64/makeappx.exe' encrypt /p AppPackages\xbsx2\xbsx2_${{ steps.extract_version.outputs.version }}_x64_Test\xbsx2_${{ steps.extract_version.outputs.version }}_x64.appx /ep "xbsx2_${{ steps.extract_version.outputs.version }}.eappx" /kt + + - name: Upload unencrypted APPX + uses: actions/upload-artifact@v4 + with: + name: unencrypted-appx + path: "AppPackages\\xbsx2_${{ steps.extract_version.outputs.version }}_x64_Test\\XboxLinux_${{ steps.extract_version.outputs.version }}_x64.appx" + + - name: Upload encrypted APPX + uses: actions/upload-artifact@v4 + with: + name: encrypted-appx + path: "xbsx2_${{ steps.extract_version.outputs.version }}.eappx"