|
| 1 | +trigger: |
| 2 | +- dev |
| 3 | + |
| 4 | +pr: |
| 5 | + branches: |
| 6 | + include: |
| 7 | + - dev |
| 8 | + |
| 9 | +pool: |
| 10 | + vmImage: 'windows-latest' |
| 11 | + |
| 12 | +variables: |
| 13 | + solution: 'PCSX2_qt.sln' |
| 14 | + buildPlatform: 'x64' |
| 15 | + appxManifest: 'pcsx2-winrt\\Package.appxmanifest' |
| 16 | + artifactName: 'msix' |
| 17 | + |
| 18 | +stages: |
| 19 | +- stage: Build |
| 20 | + jobs: |
| 21 | + - job: BuildMatrix |
| 22 | + displayName: 'Build MSIX Packages' |
| 23 | + strategy: |
| 24 | + matrix: |
| 25 | + Release: |
| 26 | + buildConfiguration: 'Release' |
| 27 | + ReleaseAVX2: |
| 28 | + buildConfiguration: 'Release AVX2' |
| 29 | + |
| 30 | + steps: |
| 31 | + - checkout: self |
| 32 | + persistCredentials: true |
| 33 | + |
| 34 | + - task: NuGetToolInstaller@1 |
| 35 | + |
| 36 | + - task: NuGetCommand@2 |
| 37 | + inputs: |
| 38 | + restoreSolution: '$(solution)' |
| 39 | + |
| 40 | + - task: PowerShell@2 |
| 41 | + name: ExtractVersion |
| 42 | + inputs: |
| 43 | + targetType: 'inline' |
| 44 | + script: | |
| 45 | + [xml]$manifest = Get-Content "$(appxManifest)" |
| 46 | + $version = $manifest.Package.Identity.Version |
| 47 | + Write-Host "##vso[task.setvariable variable=AppVersion]$version" |
| 48 | + Write-Host "Extracted AppVersion: $version" |
| 49 | +
|
| 50 | + - script: | |
| 51 | + cd bin\resources |
| 52 | + curl -L -O "https://github.com/PCSX2/pcsx2_patches/releases/download/latest/patches.zip" |
| 53 | + displayName: 'Download Patches' |
| 54 | +
|
| 55 | + - script: | |
| 56 | + curl -L -O "https://github.com/XboxEmulationHub/xbsx2-dependencies/releases/download/latest-windows-dependencies-dev/xbsx2-dependencies-dev.7z" |
| 57 | + 7z x xbsx2-dependencies-dev.7z -o"./" |
| 58 | + displayName: 'Download & Extract Dependencies' |
| 59 | +
|
| 60 | + - task: VSBuild@1 |
| 61 | + inputs: |
| 62 | + solution: '$(solution)' |
| 63 | + platform: '$(buildPlatform)' |
| 64 | + configuration: '$(buildConfiguration)' |
| 65 | + msbuildArgs: > |
| 66 | + /p:GenerateAppxPackageOnBuild=true |
| 67 | + /p:AppxPackageDir=$(Build.ArtifactStagingDirectory)\AppPackages\ |
| 68 | + /p:PlatformToolset=v143 |
| 69 | + displayName: 'Build Project' |
| 70 | + |
| 71 | + - task: PowerShell@2 |
| 72 | + name: SetPackagePath |
| 73 | + inputs: |
| 74 | + targetType: 'inline' |
| 75 | + script: | |
| 76 | + $config = "$(buildConfiguration)" |
| 77 | + $version = "$(AppVersion)" |
| 78 | + $suffix = if ($config -eq 'Release AVX2') { '_Release AVX2' } else { '' } |
| 79 | + $path = "AppPackages\xbsx2\xbsx2_${version}_x64${suffix}_Test" |
| 80 | + Write-Host "Resolved PackagePath: $path" |
| 81 | + Write-Host "##vso[task.setvariable variable=PackagePath]$path" |
| 82 | +
|
| 83 | + - task: PublishBuildArtifacts@1 |
| 84 | + inputs: |
| 85 | + PathtoPublish: '$(PackagePath)' |
| 86 | + ArtifactName: '$(artifactName)-$(buildConfiguration)' |
| 87 | + publishLocation: 'Container' |
| 88 | + displayName: 'Upload MSIX Artifact' |
| 89 | + |
| 90 | + # Optional: Commit and push changes back to dev branch |
| 91 | + - script: | |
| 92 | + git config user.name "Azure DevOps CI" |
| 93 | + git config user.email "azuredevops@example.com" |
| 94 | + git checkout dev |
| 95 | + # Example: touch a file or modify something if needed |
| 96 | + # echo "Build completed at $(Build.BuildId)" >> build_log.txt |
| 97 | + # git add build_log.txt |
| 98 | + # git commit -m "CI: Build $(Build.BuildId)" |
| 99 | + # git push origin dev |
| 100 | + displayName: 'Commit and push changes to dev branch' |
| 101 | + condition: false # Disable by default, enable if needed |
| 102 | + env: |
| 103 | + SYSTEM_ACCESSTOKEN: $(System.AccessToken) |
0 commit comments