rolling-release.yml (16062B)
1 name: Create rolling release 2 3 on: 4 pull_request: 5 paths-ignore: 6 - '**.md' 7 - 'appveyor.yml' 8 - 'scripts/*' 9 - '.github/ISSUE_TEMPLATE/*' 10 push: 11 branches: 12 - master 13 - dev 14 paths-ignore: 15 - '**.md' 16 - 'appveyor.yml' 17 - 'scripts/*' 18 - '.github/ISSUE_TEMPLATE/*' 19 workflow_dispatch: 20 21 jobs: 22 windows-build: 23 runs-on: windows-2022 24 timeout-minutes: 120 25 steps: 26 - uses: actions/checkout@v4.1.6 27 with: 28 fetch-depth: 0 29 30 - name: Cache Dependencies 31 id: cache-deps 32 uses: actions/cache@v4.0.2 33 with: 34 path: | 35 dep/msvc/deps-arm64 36 dep/msvc/deps-x64 37 key: deps ${{ hashFiles('scripts/deps/build-dependencies-windows-arm64.bat', 'scripts/deps/build-dependencies-windows-x64.bat') }} 38 39 - name: Build X64 Dependencies 40 if: steps.cache-deps.outputs.cache-hit != 'true' 41 env: 42 DEBUG: 0 43 run: scripts/deps/build-dependencies-windows-x64.bat 44 45 - name: Build ARM64 Dependencies 46 if: steps.cache-deps.outputs.cache-hit != 'true' 47 env: 48 DEBUG: 0 49 run: scripts/deps/build-dependencies-windows-arm64.bat 50 51 - name: Initialize build tag 52 shell: cmd 53 run: | 54 echo #pragma once > src/scmversion/tag.h 55 56 - name: Tag as preview build 57 if: github.ref == 'refs/heads/master' 58 shell: cmd 59 run: | 60 echo #define SCM_RELEASE_ASSET "duckstation-windows-x64-release.zip" >> src/scmversion/tag.h 61 echo #define SCM_RELEASE_TAGS {"latest", "preview"} >> src/scmversion/tag.h 62 echo #define SCM_RELEASE_TAG "preview" >> src/scmversion/tag.h 63 64 - name: Tag as dev build 65 if: github.ref == 'refs/heads/dev' 66 shell: cmd 67 run: | 68 echo #define SCM_RELEASE_ASSET "duckstation-windows-x64-release.zip" >> src/scmversion/tag.h 69 echo #define SCM_RELEASE_TAGS {"latest", "preview"} >> src/scmversion/tag.h 70 echo #define SCM_RELEASE_TAG "latest" >> src/scmversion/tag.h 71 72 - name: Update RC version fields 73 shell: cmd 74 run: | 75 cd src\scmversion 76 call update_rc_version.bat 77 cd ..\.. 78 git update-index --assume-unchanged src/duckstation-qt/duckstation-qt.rc 79 80 - name: Compile x64 release build 81 shell: cmd 82 run: | 83 call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 84 msbuild duckstation.sln -t:Build -p:Platform=x64;Configuration=ReleaseLTCG-Clang 85 86 - name: Create x64 symbols archive 87 shell: cmd 88 run: | 89 "C:\Program Files\7-Zip\7z.exe" a -r duckstation-windows-x64-release-symbols.zip ./bin/x64/*.pdb 90 91 - name: Remove extra bloat before archiving 92 shell: cmd 93 run: | 94 del /Q bin\x64\*.pdb bin\x64\*.exp bin\x64\*.lib bin\x64\*.iobj bin\x64\*.ipdb bin\x64\common-tests* 95 rename bin\x64\updater-x64-ReleaseLTCG.exe updater.exe 96 97 - name: Create x64 release archive 98 shell: cmd 99 run: | 100 "C:\Program Files\7-Zip\7z.exe" a -r duckstation-windows-x64-release.zip ./bin/x64/* 101 102 - name: Upload x64 release artifact 103 uses: actions/upload-artifact@v4.3.3 104 with: 105 name: "windows" 106 path: "duckstation-windows-x64-release*.zip" 107 108 109 windows-arm64-build: 110 runs-on: windows-2022 111 timeout-minutes: 120 112 steps: 113 - uses: actions/checkout@v4.1.6 114 with: 115 fetch-depth: 0 116 submodules: true 117 118 - name: Cache Dependencies 119 id: cache-deps 120 uses: actions/cache@v4.0.2 121 with: 122 path: | 123 dep/msvc/deps-arm64 124 dep/msvc/deps-x64 125 key: deps ${{ hashFiles('scripts/deps/build-dependencies-windows-arm64.bat', 'scripts/deps/build-dependencies-windows-x64.bat') }} 126 127 - name: Build X64 Dependencies 128 if: steps.cache-deps.outputs.cache-hit != 'true' 129 env: 130 DEBUG: 0 131 run: scripts/deps/build-dependencies-windows-x64.bat 132 133 - name: Build ARM64 Dependencies 134 if: steps.cache-deps.outputs.cache-hit != 'true' 135 env: 136 DEBUG: 0 137 run: scripts/deps/build-dependencies-windows-arm64.bat 138 139 - name: Initialize build tag 140 shell: cmd 141 run: | 142 echo #pragma once > src/scmversion/tag.h 143 144 - name: Tag as preview build 145 if: github.ref == 'refs/heads/master' 146 shell: cmd 147 run: | 148 echo #define SCM_RELEASE_ASSET "duckstation-windows-arm64-release.zip" >> src/scmversion/tag.h 149 echo #define SCM_RELEASE_TAGS {"latest", "preview"} >> src/scmversion/tag.h 150 echo #define SCM_RELEASE_TAG "preview" >> src/scmversion/tag.h 151 152 - name: Tag as dev build 153 if: github.ref == 'refs/heads/dev' 154 shell: cmd 155 run: | 156 echo #define SCM_RELEASE_ASSET "duckstation-windows-arm64-release.zip" >> src/scmversion/tag.h 157 echo #define SCM_RELEASE_TAGS {"latest", "preview"} >> src/scmversion/tag.h 158 echo #define SCM_RELEASE_TAG "latest" >> src/scmversion/tag.h 159 160 - name: Update RC version fields 161 shell: cmd 162 run: | 163 cd src\scmversion 164 call update_rc_version.bat 165 cd ..\.. 166 git update-index --assume-unchanged src/duckstation-qt/duckstation-qt.rc 167 168 - name: Compile arm64 release build 169 shell: cmd 170 run: | 171 call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64_arm64 172 msbuild duckstation.sln -t:Build -p:Platform=ARM64;Configuration=ReleaseLTCG-Clang 173 174 - name: Create arm64 symbols archive 175 shell: cmd 176 run: | 177 "C:\Program Files\7-Zip\7z.exe" a -r duckstation-windows-arm64-release-symbols.zip ./bin/ARM64/*.pdb 178 179 - name: Remove extra bloat before archiving 180 shell: cmd 181 run: | 182 del /Q bin\ARM64\*.pdb bin\ARM64\*.exp bin\ARM64\*.lib bin\ARM64\*.iobj bin\ARM64\*.ipdb bin\ARM64\common-tests* 183 rename bin\ARM64\updater-ARM64-ReleaseLTCG.exe updater.exe 184 185 - name: Create arm64 release archive 186 shell: cmd 187 run: | 188 "C:\Program Files\7-Zip\7z.exe" a -r duckstation-windows-arm64-release.zip ./bin/ARM64/* 189 190 - name: Upload arm64 release artifact 191 uses: actions/upload-artifact@v4.3.3 192 with: 193 name: "windows-arm64" 194 path: "duckstation-windows-arm64-release*.zip" 195 196 197 linux-build: 198 runs-on: ubuntu-22.04 199 timeout-minutes: 120 200 steps: 201 - uses: actions/checkout@v4.1.6 202 with: 203 fetch-depth: 0 204 205 - name: Install packages 206 shell: bash 207 run: | 208 # Workaround for https://github.com/actions/runner-images/issues/675 209 scripts/retry.sh wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - 210 sudo scripts/retry.sh apt-add-repository -n 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main' 211 212 sudo scripts/retry.sh apt-get update && 213 sudo scripts/retry.sh apt-get -y install \ 214 build-essential clang-17 cmake curl extra-cmake-modules git libasound2-dev libcurl4-openssl-dev libdbus-1-dev libdecor-0-dev libegl-dev libevdev-dev \ 215 libfontconfig-dev libfreetype-dev libfuse2 libgtk-3-dev libgudev-1.0-dev libharfbuzz-dev libinput-dev libopengl-dev libpipewire-0.3-dev libpulse-dev \ 216 libssl-dev libudev-dev libwayland-dev libx11-dev libx11-xcb-dev libxcb1-dev libxcb-composite0-dev libxcb-cursor-dev libxcb-damage0-dev libxcb-glx0-dev \ 217 libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-present-dev libxcb-randr0-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-shape0-dev \ 218 libxcb-shm0-dev libxcb-sync-dev libxcb-util-dev libxcb-xfixes0-dev libxcb-xinput-dev libxcb-xkb-dev libxext-dev libxkbcommon-x11-dev libxrandr-dev lld-17 \ 219 llvm-17 nasm ninja-build patchelf pkg-config zlib1g-dev 220 221 - name: Cache Dependencies 222 id: cache-deps 223 uses: actions/cache@v4.0.2 224 with: 225 path: ~/deps 226 key: deps ${{ hashFiles('scripts/deps/build-dependencies-linux.sh') }} 227 228 - name: Build Dependencies 229 if: steps.cache-deps.outputs.cache-hit != 'true' 230 run: scripts/deps/build-dependencies-linux.sh "$HOME/deps" 231 232 - name: Initialize build tag 233 run: | 234 echo '#pragma once' > src/scmversion/tag.h 235 236 - name: Tag as preview build 237 if: github.ref == 'refs/heads/master' 238 run: | 239 echo '#define SCM_RELEASE_ASSET "DuckStation-x64.AppImage"' >> src/scmversion/tag.h 240 echo '#define SCM_RELEASE_TAGS {"latest", "preview"}' >> src/scmversion/tag.h 241 echo '#define SCM_RELEASE_TAG "preview"' >> src/scmversion/tag.h 242 243 - name: Tag as dev build 244 if: github.ref == 'refs/heads/dev' 245 run: | 246 echo '#define SCM_RELEASE_ASSET "DuckStation-x64.AppImage"' >> src/scmversion/tag.h 247 echo '#define SCM_RELEASE_TAGS {"latest", "preview"}' >> src/scmversion/tag.h 248 echo '#define SCM_RELEASE_TAG "latest"' >> src/scmversion/tag.h 249 250 251 - name: Compile build 252 shell: bash 253 run: | 254 mkdir build 255 cd build 256 cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -DCMAKE_PREFIX_PATH="$HOME/deps" -DCMAKE_C_COMPILER=clang-17 -DCMAKE_CXX_COMPILER=clang++-17 -DCMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=lld" -DCMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=lld" -DCMAKE_SHARED_LINKER_FLAGS_INIT="-fuse-ld=lld" .. 257 cmake --build . --parallel 258 cd .. 259 scripts/appimage/make-appimage.sh $(realpath .) $(realpath ./build) $HOME/deps DuckStation-x64 260 261 - name: Upload Qt AppImage 262 uses: actions/upload-artifact@v4.3.3 263 with: 264 name: "linux-x64-appimage-qt" 265 path: "DuckStation-x64.AppImage" 266 267 268 linux-flatpak-build: 269 runs-on: ubuntu-22.04 270 container: 271 image: ghcr.io/flathub-infra/flatpak-github-actions:kde-6.7 272 options: --privileged 273 timeout-minutes: 120 274 steps: 275 - uses: actions/checkout@v4.1.6 276 with: 277 fetch-depth: 0 278 set-safe-directory: ${{ env.GITHUB_WORKSPACE }} 279 280 # Work around container ownership issue 281 - name: Set Safe Directory 282 shell: bash 283 run: git config --global --add safe.directory "*" 284 285 - name: Initialize build tag 286 run: | 287 echo '#pragma once' > src/scmversion/tag.h 288 289 - name: Generate AppStream XML 290 run: | 291 scripts/generate-metainfo.sh scripts/flatpak 292 cat scripts/flatpak/org.duckstation.DuckStation.metainfo.xml 293 294 - name: Validate AppStream XML 295 run: flatpak-builder-lint appstream scripts/flatpak/org.duckstation.DuckStation.metainfo.xml 296 297 - name: Validate manifest 298 run: flatpak-builder-lint manifest scripts/flatpak/org.duckstation.DuckStation.yaml 299 300 - name: Build Flatpak 301 uses: flathub-infra/flatpak-github-actions/flatpak-builder@23796715b3dfa4c86ddf50cf29c3cc8b3c82dca8 302 with: 303 bundle: duckstation-x64.flatpak 304 upload-artifact: false 305 manifest-path: scripts/flatpak/org.duckstation.DuckStation.yaml 306 arch: x86_64 307 build-bundle: true 308 verbose: true 309 mirror-screenshots-url: https://dl.flathub.org/media 310 branch: stable 311 cache: true 312 restore-cache: true 313 cache-key: flatpak-x64-${{ hashFiles('scripts/flatpak/**/*.yaml') }} 314 315 - name: Push to Flathub stable 316 if: github.ref == 'refs/heads/dev' 317 uses: flathub-infra/flatpak-github-actions/flat-manager@b6c92176b7f578aedd80cac74cd8f0336f618e89 318 with: 319 flat-manager-url: https://hub.flathub.org/ 320 repository: stable 321 token: ${{ secrets.FLATHUB_STABLE_TOKEN }} 322 build-log-url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} 323 324 - name: Validate build 325 run: | 326 flatpak-builder-lint repo repo 327 328 - name: Upload Flatpak 329 uses: actions/upload-artifact@v4.3.3 330 with: 331 name: "linux-flatpak" 332 path: "duckstation-x64.flatpak" 333 334 335 macos-build: 336 runs-on: macos-14 337 timeout-minutes: 120 338 steps: 339 - uses: actions/checkout@v4.1.6 340 with: 341 fetch-depth: 0 342 343 - name: Use Xcode 15.4 344 run: sudo xcode-select -s /Applications/Xcode_15.4.app 345 346 - name: Install packages 347 shell: bash 348 run: | 349 brew install curl ninja 350 351 - name: Cache Dependencies 352 id: cache-deps-mac 353 uses: actions/cache@v4.0.2 354 with: 355 path: ~/deps 356 key: deps-mac ${{ hashFiles('scripts/deps/build-dependencies-mac.sh') }} 357 358 - name: Build Dependencies 359 if: steps.cache-deps-mac.outputs.cache-hit != 'true' 360 run: scripts/deps/build-dependencies-mac.sh "$HOME/deps" 361 362 - name: Initialize build tag 363 run: | 364 echo '#pragma once' > src/scmversion/tag.h 365 366 - name: Tag as preview build 367 if: github.ref == 'refs/heads/master' 368 run: | 369 echo '#define SCM_RELEASE_ASSET "duckstation-mac-release.zip"' >> src/scmversion/tag.h 370 echo '#define SCM_RELEASE_TAGS {"latest", "preview"}' >> src/scmversion/tag.h 371 echo '#define SCM_RELEASE_TAG "preview"' >> src/scmversion/tag.h 372 373 - name: Tag as dev build 374 if: github.ref == 'refs/heads/dev' 375 run: | 376 echo '#define SCM_RELEASE_ASSET "duckstation-mac-release.zip"' >> src/scmversion/tag.h 377 echo '#define SCM_RELEASE_TAGS {"latest", "preview"}' >> src/scmversion/tag.h 378 echo '#define SCM_RELEASE_TAG "latest"' >> src/scmversion/tag.h 379 380 - name: Compile and zip .app 381 shell: bash 382 run: | 383 mkdir build 384 cd build 385 export MACOSX_DEPLOYMENT_TARGET=11.0 386 cmake -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_BUILD_TYPE=Release -DENABLE_OPENGL=OFF -DCMAKE_PREFIX_PATH="$HOME/deps" -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON -G Ninja .. 387 cmake --build . --parallel 388 mv bin/DuckStation.app . 389 codesign -s - --deep -f -v DuckStation.app 390 zip -r duckstation-mac-release.zip DuckStation.app/ 391 392 - name: Upload macOS .app 393 uses: actions/upload-artifact@v4.3.3 394 with: 395 name: "macos" 396 path: "build/duckstation-mac-release.zip" 397 398 399 create-release: 400 needs: [windows-build, windows-arm64-build, linux-build, linux-flatpak-build, macos-build] 401 runs-on: ubuntu-22.04 402 if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' 403 steps: 404 - name: Download Artifacts 405 uses: actions/download-artifact@v4.1.7 406 with: 407 path: ./artifacts/ 408 409 - name: Display Downloaded Artifacts 410 run: find ./artifacts/ 411 412 - name: Create preview release 413 if: github.ref == 'refs/heads/master' 414 uses: "marvinpinto/action-automatic-releases@latest" 415 with: 416 repo_token: "${{ secrets.GITHUB_TOKEN }}" 417 automatic_release_tag: "preview" 418 prerelease: true 419 title: "Latest Preview Build" 420 files: | 421 ./artifacts/windows/duckstation-windows-x64-release.zip 422 ./artifacts/windows/duckstation-windows-x64-release-symbols.zip 423 ./artifacts/windows-arm64/duckstation-windows-arm64-release.zip 424 ./artifacts/windows-arm64/duckstation-windows-arm64-release-symbols.zip 425 ./artifacts/linux-x64-appimage-qt/DuckStation-x64.AppImage 426 ./artifacts/linux-flatpak/duckstation-x64.flatpak 427 ./artifacts/macos/duckstation-mac-release.zip 428 429 - name: Create dev release 430 if: github.ref == 'refs/heads/dev' 431 uses: "marvinpinto/action-automatic-releases@latest" 432 with: 433 repo_token: "${{ secrets.GITHUB_TOKEN }}" 434 automatic_release_tag: "latest" 435 prerelease: false 436 title: "Latest Rolling Release" 437 files: | 438 ./artifacts/windows/duckstation-windows-x64-release.zip 439 ./artifacts/windows/duckstation-windows-x64-release-symbols.zip 440 ./artifacts/windows-arm64/duckstation-windows-arm64-release.zip 441 ./artifacts/windows-arm64/duckstation-windows-arm64-release-symbols.zip 442 ./artifacts/linux-x64-appimage-qt/DuckStation-x64.AppImage 443 ./artifacts/linux-flatpak/duckstation-x64.flatpak 444 ./artifacts/macos/duckstation-mac-release.zip 445