|
| 1 | +trigger: |
| 2 | +- azure |
| 3 | + |
| 4 | +pr: |
| 5 | +- azure |
| 6 | + |
| 7 | +variables: |
| 8 | + qt_version: '6.8.3' |
| 9 | + qt_version_major: '6' |
| 10 | + qt_modules: 'qtmultimedia qtserialport' |
| 11 | + build_type: 'ReleaseWithDebInfo' |
| 12 | + |
| 13 | +################################ |
| 14 | +# Windows Job |
| 15 | +################################ |
| 16 | +jobs: |
| 17 | +- job: Windows |
| 18 | + pool: |
| 19 | + vmImage: 'windows-latest' |
| 20 | + strategy: |
| 21 | + matrix: |
| 22 | + msvc2022: |
| 23 | + compiler: 'default' |
| 24 | + cmake_additional_param: '' |
| 25 | + clangcl: |
| 26 | + compiler: 'clang' |
| 27 | + cmake_additional_param: '-T ClangCL' |
| 28 | + |
| 29 | + steps: |
| 30 | + - checkout: self |
| 31 | + submodules: recursive |
| 32 | + path: Arduino-Source |
| 33 | + |
| 34 | + - script: | |
| 35 | + git clone --recursive https://github.com/PokemonAutomation/Packages Packages |
| 36 | + displayName: Clone Packages repo |
| 37 | +
|
| 38 | +
|
| 39 | + - task: UsePythonVersion@0 |
| 40 | + inputs: |
| 41 | + versionSpec: '3.x' |
| 42 | + |
| 43 | + - script: pip install aqtinstall |
| 44 | + displayName: Install aqtinstall |
| 45 | + |
| 46 | + - script: | |
| 47 | + aqt install-qt windows desktop $(qt_version) win64_msvc2022_64 -m $(qt_modules) -O C:\Qt |
| 48 | + displayName: Install Qt (Windows) |
| 49 | +
|
| 50 | + - script: | |
| 51 | + cd Arduino-Source/SerialPrograms |
| 52 | + mkdir bin |
| 53 | + cd bin |
| 54 | + cmake .. -DQT_MAJOR=$(qt_version_major) $(cmake_additional_param) -DCMAKE_PREFIX_PATH=C:/Qt/$(qt_version)/msvc2022_64 |
| 55 | + cmake --build . --config $(build_type) |
| 56 | + displayName: Configure and Build (Windows) |
| 57 | +
|
| 58 | + - powershell: | |
| 59 | + robocopy Packages/SerialPrograms/Resources Output/Resources /s |
| 60 | + robocopy Packages/PABotBase/PABotBase-Switch Output/PABotBase /s |
| 61 | + robocopy Arduino-Source/SerialPrograms/bin Output/Binaries *.dll |
| 62 | + robocopy Arduino-Source/SerialPrograms/bin/$(build_type) Output/Binaries SerialPrograms.exe |
| 63 | + echo https://github.com/$(Build.Repository.Name)/commit/$(Build.SourceVersion) > Output/version.txt |
| 64 | + if ($lastexitcode -eq 1) { exit 0 } else { exit 1 } |
| 65 | + displayName: Copy resources |
| 66 | +
|
| 67 | + - powershell: | |
| 68 | + mkdir Artifact |
| 69 | + if (Test-Path Output) { Copy-Item -Recurse Output/* Artifact/ } |
| 70 | + if (Test-Path Arduino-Source/SerialPrograms/bin) { Copy-Item -Recurse Arduino-Source/SerialPrograms/bin/* Artifact/ } |
| 71 | + Compress-Archive -Path Artifact/* -DestinationPath build-output.zip |
| 72 | + displayName: Zip build output (Windows) |
| 73 | +
|
| 74 | + - task: PublishBuildArtifacts@1 |
| 75 | + inputs: |
| 76 | + pathToPublish: 'build-output.zip' |
| 77 | + artifactName: 'SerialPrograms-Windows-$(compiler)-Qt$(qt_version)' |
| 78 | + |
| 79 | +################################ |
| 80 | +# Linux Job |
| 81 | +################################ |
| 82 | +- job: Linux |
| 83 | + pool: |
| 84 | + vmImage: 'ubuntu-24.04' |
| 85 | + strategy: |
| 86 | + matrix: |
| 87 | + gcc: |
| 88 | + compiler: 'default' |
| 89 | + cmake_additional_param: '' |
| 90 | + clang: |
| 91 | + compiler: 'clang' |
| 92 | + cmake_additional_param: '-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++' |
| 93 | + |
| 94 | + steps: |
| 95 | + - checkout: self |
| 96 | + submodules: recursive |
| 97 | + path: Arduino-Source |
| 98 | + |
| 99 | + - script: | |
| 100 | + git clone --recursive https://github.com/PokemonAutomation/Packages Packages |
| 101 | + displayName: Clone Packages repo |
| 102 | +
|
| 103 | + - task: UsePythonVersion@0 |
| 104 | + inputs: |
| 105 | + versionSpec: '3.x' |
| 106 | + |
| 107 | + - script: pip install aqtinstall |
| 108 | + displayName: Install aqtinstall |
| 109 | + |
| 110 | + - script: | |
| 111 | + aqt install-qt linux desktop $(qt_version) gcc_64 -m $(qt_modules) -O $HOME/Qt |
| 112 | + displayName: Install Qt (Linux) |
| 113 | +
|
| 114 | + - script: | |
| 115 | + sudo apt update |
| 116 | + sudo apt install -y libopencv-dev |
| 117 | + displayName: Install dependencies (Linux) |
| 118 | +
|
| 119 | + - script: | |
| 120 | + cd Arduino-Source/SerialPrograms |
| 121 | + mkdir bin |
| 122 | + cd bin |
| 123 | + cmake .. -DQT_MAJOR=$(qt_version_major) $(cmake_additional_param) -DCMAKE_PREFIX_PATH=$HOME/Qt/$(qt_version)/gcc_64 -DCMAKE_BUILD_TYPE=$(build_type) |
| 124 | + cmake --build . --config $(build_type) |
| 125 | + displayName: Configure and Build (Linux) |
| 126 | +
|
| 127 | + - script: | |
| 128 | + mkdir Artifact |
| 129 | + cp -r Arduino-Source/SerialPrograms/bin/* Artifact/ || true |
| 130 | + zip -r build-output.zip Artifact |
| 131 | + displayName: Zip build output (Linux) |
| 132 | +
|
| 133 | + - task: PublishBuildArtifacts@1 |
| 134 | + inputs: |
| 135 | + pathToPublish: 'build-output.zip' |
| 136 | + artifactName: 'SerialPrograms-Linux-$(compiler)-Qt$(qt_version)' |
| 137 | + |
| 138 | +################################ |
| 139 | +# macOS Job |
| 140 | +################################ |
| 141 | +- job: MacOS |
| 142 | + pool: |
| 143 | + vmImage: 'macos-13' |
| 144 | + |
| 145 | + steps: |
| 146 | + - checkout: self |
| 147 | + submodules: recursive |
| 148 | + path: Arduino-Source |
| 149 | + |
| 150 | + - script: | |
| 151 | + git clone --recursive https://github.com/PokemonAutomation/Packages Packages |
| 152 | + displayName: Clone Packages repo |
| 153 | +
|
| 154 | + - task: UsePythonVersion@0 |
| 155 | + inputs: |
| 156 | + versionSpec: '3.x' |
| 157 | + |
| 158 | + - script: pip install aqtinstall |
| 159 | + displayName: Install aqtinstall |
| 160 | + |
| 161 | + - script: | |
| 162 | + aqt install-qt mac desktop $(qt_version) clang_64 -m $(qt_modules) -O $HOME/Qt |
| 163 | + displayName: Install Qt (macOS) |
| 164 | +
|
| 165 | + - script: | |
| 166 | + brew install opencv onnxruntime |
| 167 | + displayName: Install dependencies (macOS) |
| 168 | +
|
| 169 | + - script: | |
| 170 | + cd Arduino-Source/SerialPrograms |
| 171 | + mkdir bin |
| 172 | + cd bin |
| 173 | + cmake .. -DQT_MAJOR=$(qt_version_major) -DCMAKE_PREFIX_PATH=$HOME/Qt/$(qt_version)/macos -DCMAKE_BUILD_TYPE=$(build_type) |
| 174 | + cmake --build . --config $(build_type) |
| 175 | + displayName: Configure and Build (macOS) |
| 176 | +
|
| 177 | + - script: | |
| 178 | + mkdir Artifact |
| 179 | + cp -r Arduino-Source/SerialPrograms/bin/* Artifact/ || true |
| 180 | + zip -r build-output.zip Artifact |
| 181 | + displayName: Zip build output (macOS) |
| 182 | +
|
| 183 | + - task: PublishBuildArtifacts@1 |
| 184 | + inputs: |
| 185 | + pathToPublish: 'build-output.zip' |
| 186 | + artifactName: 'SerialPrograms-macOS-Qt$(qt_version)' |
0 commit comments