sdl12-compat: Added GitHub release workflow

From 20ab1608972b20f872fbe1b3647ac09b59f38654 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Sun, 26 Oct 2025 13:29:14 -0700
Subject: [PATCH] Added GitHub release workflow

---
 .github/workflows/release.yml                 |  631 +++++++
 CMakeLists.txt                                |    4 +-
 build-scripts/build-release.py                | 1556 +++++++++++++++++
 build-scripts/create-release.py               |   45 +
 build-scripts/pkg-support/msvc/INSTALL.md     |   11 +
 build-scripts/pkg-support/msvc/README.md      |   21 +
 .../pkg-support/msvc/x64/INSTALL.md.in        |    7 +
 .../pkg-support/msvc/x86/INSTALL.md.in        |    7 +
 build-scripts/release-info.json               |   87 +
 build-scripts/test-versioning.sh              |  101 ++
 .../update-version.sh                         |    2 +
 11 files changed, 2469 insertions(+), 3 deletions(-)
 create mode 100644 .github/workflows/release.yml
 create mode 100755 build-scripts/build-release.py
 create mode 100755 build-scripts/create-release.py
 create mode 100644 build-scripts/pkg-support/msvc/INSTALL.md
 create mode 100644 build-scripts/pkg-support/msvc/README.md
 create mode 100644 build-scripts/pkg-support/msvc/x64/INSTALL.md.in
 create mode 100644 build-scripts/pkg-support/msvc/x86/INSTALL.md.in
 create mode 100644 build-scripts/release-info.json
 create mode 100755 build-scripts/test-versioning.sh
 rename update_version.sh => build-scripts/update-version.sh (98%)

diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 000000000..889fbc02b
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,631 @@
+name: 'release'
+run-name: 'Create sdl12-compat release artifacts for ${{ inputs.commit }}'
+
+on:
+  workflow_dispatch:
+    inputs:
+      commit:
+        description: 'Commit of sdl12-compat'
+        required: true
+
+jobs:
+
+  src:
+    runs-on: ubuntu-latest
+    outputs:
+      project: ${{ steps.releaser.outputs.project }}
+      version: ${{ steps.releaser.outputs.version }}
+      src-tar-gz: ${{ steps.releaser.outputs.src-tar-gz }}
+      src-tar-xz: ${{ steps.releaser.outputs.src-tar-xz }}
+      src-zip: ${{ steps.releaser.outputs.src-zip }}
+    steps:
+      - name: 'Set up Python'
+        uses: actions/setup-python@v5
+        with:
+          python-version: '3.11'
+      - name: 'Fetch build-release.py'
+        uses: actions/checkout@v4
+        with:
+          ref: ${{ inputs.commit }}
+          sparse-checkout: 'build-scripts/build-release.py'
+      - name: 'Set up SDL sources'
+        uses: actions/checkout@v4
+        with:
+          ref: ${{ inputs.commit }}
+          path: 'SDL'
+          fetch-depth: 0
+      - name: 'Build Source archive'
+        id: releaser
+        shell: bash
+        env:
+          GH_TOKEN: ${{ github.token }}
+        run: |
+          python build-scripts/build-release.py \
+            --actions source \
+            --commit ${{ inputs.commit }} \
+            --root "${{ github.workspace }}/SDL" \
+            --github \
+            --debug
+      - name: 'Store source archives'
+        uses: actions/upload-artifact@v4
+        with:
+          name: sources
+          path: '${{ github.workspace}}/dist'
+      - name: 'Generate summary'
+        run: |
+          echo "Run the following commands to download all artifacts:" >> $GITHUB_STEP_SUMMARY
+          echo '```' >> $GITHUB_STEP_SUMMARY
+          echo "mkdir -p /tmp/${{ steps.releaser.outputs.project }}-${{ steps.releaser.outputs.version }}" >> $GITHUB_STEP_SUMMARY
+          echo "cd /tmp/${{ steps.releaser.outputs.project }}-${{ steps.releaser.outputs.version }}" >> $GITHUB_STEP_SUMMARY
+          echo "gh run -R ${{ github.repository }} download ${{ github.run_id }}" >> $GITHUB_STEP_SUMMARY
+          echo '```' >> $GITHUB_STEP_SUMMARY
+
+  linux-verify:
+    needs: [src]
+    runs-on: ubuntu-latest
+    steps:
+      - name: 'Set up Python'
+        uses: actions/setup-python@v5
+        with:
+          python-version: '3.11'
+      - name: 'Download source archives'
+        uses: actions/download-artifact@v4
+        with:
+          name: sources
+          path: '/tmp'
+      - name: 'Unzip ${{ needs.src.outputs.src-zip }}'
+        id: zip
+        run: |
+          set -e
+          mkdir /tmp/zipdir
+          cd /tmp/zipdir
+          unzip "/tmp/${{ needs.src.outputs.src-zip }}"
+          echo "path=/tmp/zipdir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
+      - name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
+        id: tar
+        run: |
+          set -e
+          mkdir -p /tmp/tardir
+          tar -C /tmp/tardir -v -x -f "/tmp/${{ needs.src.outputs.src-tar-gz }}"
+          echo "path=/tmp/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
+      - name: 'Compare contents of ${{ needs.src.outputs.src-zip }} and  ${{ needs.src.outputs.src-tar-gz }}'
+        run: |
+          set -e
+          diff "${{ steps.zip.outputs.path }}" "${{ steps.tar.outputs.path }}"
+      - name: 'Test versioning'
+        shell: bash
+        run: |
+          ${{ steps.tar.outputs.path }}/build-scripts/test-versioning.sh
+      - name: 'Fetch build-release.py'
+        uses: actions/checkout@v4
+        with:
+          ref: ${{ inputs.commit }}
+          sparse-checkout: |
+            build-scripts/build-release.py
+            .github/actions/setup-ninja/action.yml
+      - name: 'Download dependencies'
+        id: deps
+        env:
+          GH_TOKEN: ${{ github.token }}
+        run: |
+          python build-scripts/build-release.py \
+            --actions download \
+            --commit ${{ inputs.commit }} \
+            --root "${{ steps.tar.outputs.path }}" \
+            --github \
+            --debug
+      - name: 'Install Linux dependencies'
+        run: |
+          sudo apt-get update -y
+          sudo apt-get install -y \
+            gnome-desktop-testing libasound2-dev libpulse-dev libaudio-dev libjack-dev libsndio-dev \
+            libusb-1.0-0-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev \
+            libxss-dev libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \
+            libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev
+      - name: 'Extract dependencies, build and install them'
+        id: deps-build
+        run: |
+          tar -C /tmp -v -x -f "${{ steps.deps.outputs.dep-path }}/SDL3-${{ steps.deps.outputs.dep-sdl-version }}.tar.gz"
+          cmake -S /tmp/SDL3-${{ steps.deps.outputs.dep-sdl-version }} -B /tmp/SDL-build -DSDL_UNIX_CONSOLE_BUILD=ON -DCMAKE_INSTALL_PREFIX=/tmp/deps-prefix
+          cmake --build /tmp/SDL-build
+          cmake --install /tmp/SDL-build
+          echo "path=/tmp/deps-prefix" >>$GITHUB_OUTPUT
+      - name: Set up ninja
+        uses: ./.github/actions/setup-ninja
+      - name: 'CMake (configure + build)'
+        run: |
+          cmake \
+            -GNinja \
+            -S ${{ steps.tar.outputs.path }} \
+            -B /tmp/build \
+            -DCMAKE_PREFIX_PATH="${{ steps.deps-build.outputs.path }}"
+          cmake --build /tmp/build --verbose
+          # ctest --test-dir /tmp/build --no-tests=error --output-on-failure
+
+#  dmg:
+#    needs: [src]
+#    runs-on: macos-latest
+#    outputs:
+#      dmg: ${{ steps.releaser.outputs.dmg }}
+#    steps:
+#      - name: 'Set up Python'
+#        uses: actions/setup-python@v5
+#        with:
+#          python-version: '3.11'
+#      - name: 'Fetch build-release.py'
+#        uses: actions/checkout@v4
+#        with:
+#          ref: ${{ inputs.commit }}
+#          sparse-checkout: 'build-scripts/build-release.py'
+#      - name: 'Install nasm'
+#        run: |
+#          brew install nasm
+#      - name: 'Download source archives'
+#        uses: actions/download-artifact@v4
+#        with:
+#          name: sources
+#          path: '${{ github.workspace }}'
+#      - name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
+#        id: tar
+#        run: |
+#          mkdir -p "${{ github.workspace }}/tardir"
+#          tar -C "${{ github.workspace }}/tardir" -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}"
+#          echo "path=${{ github.workspace }}/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
+#      - name: 'Download external dependencies'
+#        run: |
+#          sh "${{ steps.tar.outputs.path }}/external/download.sh" --depth 1
+#      - name: 'Build SDL3_ttf.dmg'
+#        id: releaser
+#        shell: bash
+#        env:
+#          GH_TOKEN: ${{ github.token }}
+#        run: |
+#          python build-scripts/build-release.py \
+#            --actions dmg \
+#            --commit ${{ inputs.commit }} \
+#            --root "${{ steps.tar.outputs.path }}" \
+#            --github \
+#            --debug
+#      - name: 'Store DMG image file'
+#        uses: actions/upload-artifact@v4
+#        with:
+#          name: dmg
+#          path: '${{ github.workspace }}/dist'
+#
+#  dmg-verify:
+#    needs: [dmg, src]
+#    runs-on: macos-latest
+#    steps:
+#      - name: 'Set up Python'
+#        uses: actions/setup-python@v5
+#        with:
+#          python-version: '3.11'
+#      - name: 'Fetch build-release.py'
+#        uses: actions/checkout@v4
+#        with:
+#          ref: ${{ inputs.commit }}
+#          sparse-checkout: 'build-scripts/build-release.py'
+#      - name: 'Download source archives'
+#        uses: actions/download-artifact@v4
+#        with:
+#          name: sources
+#          path: '${{ github.workspace }}'
+#      - name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
+#        id: src
+#        run: |
+#          mkdir -p /tmp/tardir
+#          tar -C /tmp/tardir -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}"
+#          echo "path=/tmp/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
+#      - name: 'Download dependencies'
+#        id: deps
+#        env:
+#          GH_TOKEN: ${{ github.token }}
+#        run: |
+#          python build-scripts/build-release.py \
+#            --actions download \
+#            --commit ${{ inputs.commit }} \
+#            --root "${{ steps.src.outputs.path }}" \
+#            --github \
+#            --debug
+#      - name: 'Mount dependencies'
+#        id: deps-mount
+#        run: |
+#          hdiutil attach "${{ steps.deps.outputs.dep-path }}/SDL3-${{ steps.deps.outputs.dep-sdl-version }}.dmg"
+#          sdl_mount_pount="/Volumes/SDL3"
+#          if [ ! -d "$sdl_mount_pount/SDL3.xcframework" ]; then
+#            echo "Cannot find SDL3.xcframework!"
+#            exit 1
+#          fi
+#          echo "path=${sdl_mount_pount}" >>$GITHUB_OUTPUT
+#      - name: 'Download ${{ needs.dmg.outputs.dmg }}'
+#        uses: actions/download-artifact@v4
+#        with:
+#          name: dmg
+#          path: '${{ github.workspace }}'
+#      - name: 'Mount ${{ needs.dmg.outputs.dmg }}'
+#        id: mount
+#        run: |
+#          hdiutil attach '${{ github.workspace }}/${{ needs.dmg.outputs.dmg }}'
+#          mount_point="/Volumes/${{ needs.src.outputs.project }}"
+#          if [ ! -d "$mount_point/${{ needs.src.outputs.project }}.xcframework" ]; then
+#            echo "Cannot find ${{ needs.src.outputs.project }}.xcframework!"
+#            exit 1
+#          fi
+#          echo "mount-point=${mount_point}">>$GITHUB_OUTPUT
+#      - name: 'Verify presence of optional frameworks'
+#        run: |
+#          OPTIONAL_FRAMEWORKS="gme opus wavpack xmp"
+#          rc=0
+#          for opt in $OPTIONAL_FRAMEWORKS; do
+#            fw_path="${{ steps.mount.outputs.mount-point }}/optional/${opt}.xcframework"
+#            if [ -d "${fw_path}" ]; then
+#              echo "$fw_path OK"
+#            else
+#              echo "$fw_path MISSING"
+#              rc=1
+#            fi
+#          done
+#          exit $rc
+#      - name: 'CMake (configure + build) Darwin'
+#        run: |
+#          set -e
+#          cmake -S "${{ steps.src.outputs.path }}/cmake/test"               \
+#              -DTEST_SHARED=TRUE                                            \
+#              -DTEST_SHARED=TRUE                                            \
+#              -DTEST_STATIC=FALSE                                           \
+#              -DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount-point }};${{ steps.deps-mount.outputs.path }}" \
+#              -DCMAKE_SYSTEM_NAME=Darwin                                    \
+#              -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"                      \
+#              -Werror=dev                                                   \
+#              -B build_darwin
+#          cmake --build build_darwin --config Release --verbose
+#
+#      - name: 'CMake (configure + build) iOS'
+#        run: |
+#          cmake -S "${{ steps.src.outputs.path }}/cmake/test"               \
+#              -DTEST_SHARED=TRUE                                            \
+#              -DTEST_STATIC=FALSE                                           \
+#              -DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount-point }};${{ steps.deps-mount.outputs.path }}" \
+#              -DCMAKE_SYSTEM_NAME=iOS                                       \
+#              -DCMAKE_OSX_ARCHITECTURES="arm64"                             \
+#              -Werror=dev                                                   \
+#              -B build_ios
+#          cmake --build build_ios --config Release --verbose
+#      - name: 'CMake (configure + build) tvOS'
+#        run: |
+#          cmake -S "${{ steps.src.outputs.path }}/cmake/test"               \
+#              -DTEST_SHARED=TRUE                                            \
+#              -DTEST_STATIC=FALSE                                           \
+#              -DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount-point }};${{ steps.deps-mount.outputs.path }}" \
+#              -DCMAKE_SYSTEM_NAME=tvOS                                      \
+#              -DCMAKE_OSX_ARCHITECTURES="arm64"                             \
+#              -Werror=dev                                                   \
+#              -B build_tvos
+#          cmake --build build_tvos --config Release --verbose
+#      - name: 'CMake (configure + build) iOS simulator'
+#        run: |
+#          sysroot=$(xcodebuild -version -sdk iphonesimulator Path)
+#          echo "sysroot=$sysroot"
+#          cmake -S "${{ steps.src.outputs.path }}/cmake/test"               \
+#              -DTEST_SHARED=TRUE                                            \
+#              -DTEST_STATIC=FALSE                                           \
+#              -DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount-point }};${{ steps.deps-mount.outputs.path }}" \
+#              -DCMAKE_SYSTEM_NAME=iOS                                       \
+#              -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"                      \
+#              -DCMAKE_OSX_SYSROOT="${sysroot}"                              \
+#              -Werror=dev                                                   \
+#              -B build_ios_simulator
+#          cmake --build build_ios_simulator --config Release --verbose
+#      - name: 'CMake (configure + build) tvOS simulator'
+#        run: |
+#          sysroot=$(xcodebuild -version -sdk appletvsimulator Path)
+#          echo "sysroot=$sysroot"
+#          cmake -S "${{ steps.src.outputs.path }}/cmake/test"               \
+#              -DTEST_SHARED=TRUE                                            \
+#              -DTEST_STATIC=FALSE                                           \
+#              -DCMAKE_PREFIX_PATH="${{ steps.mount.outputs.mount-point }};${{ steps.deps-mount.outputs.path }}" \
+#              -DCMAKE_SYSTEM_NAME=tvOS                                      \
+#              -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"                      \
+#              -DCMAKE_OSX_SYSROOT="${sysroot}"                              \
+#              -Werror=dev                                                   \
+#              -B build_tvos_simulator
+#          cmake --build build_tvos_simulator --config Release --verbose
+  msvc:
+    needs: [src]
+    runs-on: windows-2025
+    outputs:
+      VC-x86: ${{ steps.releaser.outputs.VC-x86 }}
+      VC-x64: ${{ steps.releaser.outputs.VC-x64 }}
+      VC-devel: ${{ steps.releaser.outputs.VC-devel }}
+    steps:
+      - name: 'Set up Python'
+        uses: actions/setup-python@v5
+        with:
+          python-version: '3.11'
+      - name: 'Fetch build-release.py'
+        uses: actions/checkout@v4
+        with:
+          ref: ${{ inputs.commit }}
+          sparse-checkout: 'build-scripts/build-release.py'
+      - name: 'Download source archives'
+        uses: actions/download-artifact@v4
+        with:
+          name: sources
+          path: '${{ github.workspace }}'
+      - name: 'Unzip ${{ needs.src.outputs.src-zip }}'
+        id: zip
+        run: |
+          New-Item C:\temp -ItemType Directory -ErrorAction SilentlyContinue
+          cd C:\temp
+          unzip "${{ github.workspace }}/${{ needs.src.outputs.src-zip }}"
+          echo "path=C:\temp\${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$Env:GITHUB_OUTPUT
+#      - name: 'Download external dependencies'
+#        run: |
+#          ${{ steps.zip.outputs.path }}/external/Get-GitModules.ps1
+      - name: 'Build MSVC binary archives'
+        id: releaser
+        env:
+          GH_TOKEN: ${{ github.token }}
+        run: |
+          python build-scripts/build-release.py `
+            --actions download msvc `
+            --commit ${{ inputs.commit }} `
+            --root "${{ steps.zip.outputs.path }}" `
+            --github `
+            --debug
+      - name: 'Store MSVC archives'
+        uses: actions/upload-artifact@v4
+        with:
+          name: msvc
+          path: '${{ github.workspace }}/dist'
+
+  msvc-verify:
+    needs: [msvc, src]
+    runs-on: windows-latest
+    steps:
+      - name: 'Fetch .github/actions/setup-ninja/action.yml'
+        uses: actions/checkout@v4
+        with:
+          ref: ${{ inputs.commit }}
+          sparse-checkout: |
+            .github/actions/setup-ninja/action.yml
+            build-scripts/build-release.py
+      - name: 'Set up Python'
+        uses: actions/setup-python@v5
+        with:
+          python-version: '3.11'
+      - name: Set up ninja
+        uses: ./.github/actions/setup-ninja
+      - name: 'Download source archives'
+        uses: actions/download-artifact@v4
+        with:
+          name: sources
+          path: '${{ github.workspace }}'
+      - name: 'Unzip ${{ needs.src.outputs.src-zip }}'
+        id: src
+        run: |
+          mkdir '${{ github.workspace }}/sources'
+          cd '${{ github.workspace }}/sources'
+          unzip "${{ github.workspace }}/${{ needs.src.outputs.src-zip }}"
+          echo "path=${{ github.workspace }}/sources/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$env:GITHUB_OUTPUT
+      - name: 'Download dependencies'
+        id: deps
+        env:
+          GH_TOKEN: ${{ github.token }}
+        run: |
+          python build-scripts/build-release.py `
+            --actions download `
+            --commit ${{ inputs.commit }} `
+            --root "${{ steps.src.outputs.path }}" `
+            --github `
+            --debug
+      - name: 'Extract dependencies'
+        id: deps-extract
+        run: |
+          mkdir '${{ github.workspace }}/deps-vc'
+          cd '${{ github.workspace }}/deps-vc'
+          unzip "${{ steps.deps.outputs.dep-path }}/SDL3-devel-${{ steps.deps.outputs.dep-sdl-version }}-VC.zip"
+          echo "path=${{ github.workspace }}/deps-vc" >>$env:GITHUB_OUTPUT
+      - name: 'Download MSVC binaries'
+        uses: actions/download-artifact@v4
+        with:
+          name: msvc
+          path: '${{ github.workspace }}'
+      - name: 'Unzip ${{ needs.msvc.outputs.VC-devel }}'
+        id: bin
+        run: |
+          mkdir '${{ github.workspace }}/vc'
+          cd '${{ github.workspace }}/vc'
+          unzip "${{ github.workspace }}/${{ needs.msvc.outputs.VC-devel }}"
+          echo "path=${{ github.workspace }}/vc/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$env:GITHUB_OUTPUT
+      - name: 'Configure vcvars x86'
+        uses: ilammy/msvc-dev-cmd@v1
+        with:
+          arch: x64_x86
+      - name: 'CMake (configure + build + tests) x86'
+        run: |
+          cmake -S "${{ steps.src.outputs.path }}/cmake/test"     `
+              -B build_x86                                        `
+              -GNinja                                             `
+              -DCMAKE_BUILD_TYPE=Debug                            `
+              -Werror=dev                                         `
+              -DTEST_SHARED=TRUE                                  `
+              -DTEST_STATIC=FALSE                                 `
+              -DCMAKE_SUPPRESS_REGENERATION=TRUE                  `
+              -DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }};${{ steps.deps-extract.outputs.path }}"
+          Start-Sleep -Seconds 2
+          cmake --build build_x86 --config Release --verbose
+      - name: 'Configure vcvars x64'
+        uses: ilammy/msvc-dev-cmd@v1
+        with:
+          arch: x64
+      - name: 'CMake (configure + build + tests) x64'
+        run: |
+          cmake -S "${{ steps.src.outputs.path }}/cmake/test"     `
+              -B build_x64                                        `
+              -GNinja                                             `
+              -DCMAKE_BUILD_TYPE=Debug                            `
+              -Werror=dev                                         `
+              -DTEST_SHARED=TRUE                                  `
+              -DTEST_STATIC=FALSE                                 `
+              -DCMAKE_SUPPRESS_REGENERATION=TRUE                  `
+              -DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }};${{ steps.deps-extract.outputs.path }}"
+          Start-Sleep -Seconds 2
+          cmake --build build_x64 --config Release --verbose
+#      - name: 'Configure vcvars arm64'
+#        uses: ilammy/msvc-dev-cmd@v1
+#        with:
+#          arch: x64_arm64
+#      - name: 'CMake (configure + build + tests) arm64'
+#        run: |
+#          cmake -S "${{ steps.src.outputs.path }}/cmake/test"     `
+#              -B build_arm64                                        `
+#              -GNinja                                             `
+#              -DCMAKE_BUILD_TYPE=Debug                            `
+#              -Werror=dev                                         `
+#              -DTEST_SHARED=TRUE                                  `
+#              -DTEST_STATIC=FALSE                                 `
+#              -DCMAKE_SUPPRESS_REGENERATION=TRUE                  `
+#              -DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }};${{ steps.deps-extract.outputs.path }}"
+#          Start-Sleep -Seconds 2
+#          cmake --build build_arm64 --config Release --verbose
+
+#  mingw:
+#    needs: [src]
+#    runs-on: ubuntu-24.04  # FIXME: current ubuntu-latest ships an outdated mingw, replace with ubuntu-latest once 24.04 becomes the new default
+#    outputs:
+#      mingw-devel-tar-gz: ${{ steps.releaser.outputs.mingw-devel-tar-gz }}
+#      mingw-devel-tar-xz: ${{ steps.releaser.outputs.mingw-devel-tar-xz }}
+#    steps:
+#      - name: 'Set up Python'
+#        uses: actions/setup-python@v5
+#        with:
+#          python-version: '3.11'
+#      - name: 'Fetch build-release.py'
+#        uses: actions/checkout@v4
+#        with:
+#          ref: ${{ inputs.commit }}
+#          sparse-checkout: 'build-scripts/build-release.py'
+#      - name: 'Install Mingw toolchain'
+#        run: |
+#          sudo apt-get update -y
+#          sudo apt-get install -y gcc-mingw-w64 g++-mingw-w64 ninja-build
+#      - name: 'Download source archives'
+#        uses: actions/download-artifact@v4
+#        with:
+#          name: sources
+#          path: '${{ github.workspace }}'
+#      - name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
+#        id: tar
+#        run: |
+#          mkdir -p /tmp/tardir
+#          tar -C /tmp/tardir -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}"
+#          echo "path=/tmp/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
+#      - name: 'Download external dependencies'
+#        run: |
+#          sh "${{ steps.tar.outputs.path }}/external/download.sh" --depth 1
+#      - name: 'Build MinGW binary archives'
+#        id: releaser
+#        env:
+#          GH_TOKEN: ${{ github.token }}
+#        run: |
+#          python build-scripts/build-release.py \
+#            --actions download mingw \
+#            --commit ${{ inputs.commit }} \
+#            --root "${{ steps.tar.outputs.path }}" \
+#            --github \
+#            --debug
+#      - name: 'Store MinGW archives'
+#        uses: actions/upload-artifact@v4
+#        with:
+#          name: mingw
+#          path: '${{ github.workspace }}/dist'
+#
+#  mingw-verify:
+#    needs: [mingw, src]
+#    runs-on: ubuntu-latest
+#    steps:
+#      - name: 'Set up Python'
+#        uses: actions/setup-python@v5
+#        with:
+#          python-version: '3.11'
+#      - name: 'Fetch build-release.py'
+#        uses: actions/checkout@v4
+#        with:
+#          ref: ${{ inputs.commit }}
+#          sparse-checkout: 'build-scripts/build-release.py'
+#      - name: 'Install Mingw toolchain'
+#        run: |
+#          sudo apt-get update -y
+#          sudo apt-get install -y gcc-mingw-w64 g++-mingw-w64 ninja-build
+#      - name: 'Download source archives'
+#        uses: actions/download-artifact@v4
+#        with:
+#          name: sources
+#          path: '${{ github.workspace }}'
+#      - name: 'Untar ${{ needs.src.outputs.src-tar-gz }}'
+#        id: src
+#        run: |
+#          mkdir -p /tmp/tardir
+#          tar -C /tmp/tardir -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}"
+#          echo "path=/tmp/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT
+#      - name: 'Download dependencies'
+#        id: deps
+#        env:
+#          GH_TOKEN: ${{ github.token }}
+#        run: |
+#          python build-scripts/build-release.py \
+#            --actions download \
+#            --commit ${{ inputs.commit }} \
+#            --root "${{ steps.src.outputs.path }}" \
+#            --github \
+#            --debug
+#      - name: 'Untar and install dependencies'
+#        id: deps-extract
+#        run: |
+#          mkdir -p /tmp/deps-mingw/cmake
+#          mkdir -p /tmp/deps-mingw/i686-w64-mingw32
+#          mkdir -p /tmp/deps-mingw/x86_64-w64-mingw32
+#
+#          mkdir -p /tmp/deps-mingw-extract/sdl3
+#          tar -C /tmp/deps-mingw-extract/sdl3 -v -x -f "${{ steps.deps.outputs.dep-path }}/SDL3-devel-${{ steps.deps.outputs.dep-sdl-version }}-mingw.tar.gz"
+#          make -C /tmp/deps-mingw-extract/sdl3/SDL3-${{ steps.deps.outputs.dep-sdl-version }} install-all DESTDIR=/tmp/deps-mingw
+#
+#          # FIXME: this should be fixed in SDL3 releases after 3.1.3
+#          mkdir -p /tmp/deps-mingw/cmake
+#          cp -rv /tmp/deps-mingw-extract/sdl3/SDL3-${{ steps.deps.outputs.dep-sdl-version }}/cmake/* /tmp/deps-mingw/cmake
+#      - name: 'Download MinGW binaries'
+#        uses: actions/download-artifact@v4
+#        with:
+#          name: mingw
+#          path: '${{ github.workspace }}'
+#      - name: 'Untar and install ${{ needs.mingw.outputs.mingw-devel-tar-gz }}'
+#        id: bin
+#        run: |
+#          mkdir -p /tmp/mingw-tardir
+#          tar -C /tmp/mingw-tardir -v -x -f "${{ github.workspace }}/${{ needs.mingw.outputs.mingw-devel-tar-gz }}"
+#          make -C /tmp/mingw-tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }} install-all DESTDIR=/tmp/deps-mingw
+#      - name: 'CMake (configure + build) i686'
+#        run: |
+#          set -e
+#          cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
+#              -DCMAKE_BUILD_TYPE="Release" \
+#              -DTEST_SHARED=TRUE \
+#              -DTEST_STATIC=TRUE \
+#              -DCMAKE_PREFIX_PATH="/tmp/deps-mingw" \
+#              -DCMAKE_TOOLCHAIN_FILE="${{ steps.src.outputs.path }}/build-scripts/cmake-toolchain-mingw64-i686.cmake" \
+#              -Werror=dev \
+#              -B build_x86
+#          cmake --build build_x86 --config Release --verbose
+#      - name: 'CMake (configure + build) x86_64'
+#        run: |
+#          set -e
+#          cmake -S "${{ steps.src.outputs.path }}/cmake/test" \
+#              -DCMAKE_BUILD_TYPE="Release" \
+#              -DTEST_SHARED=TRUE \
+#              -DTEST_STATIC=TRUE \
+#              -DCMAKE_PREFIX_PATH="/tmp/deps-mingw" \
+#              -DCMAKE_TOOLCHAIN_FILE="${{ steps.src.outputs.path }}/build-scripts/cmake-toolchain-mingw64-x86_64.cmake" \
+#              -Werror=dev \
+#              -B build_x64
+#          cmake --build build_x64 --config Release --verbose
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 45f346d2b..6094ec958 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,9 +3,7 @@
 #        cmake -DSDL2_INCLUDE_DIR=/opt/SDL2/include/SDL2 [other stuff]
 
 cmake_minimum_required(VERSION 3.0.0...4.0)
-project(sdl12_compat
-        VERSION 1.2.69
-        LANGUAGES C)
+project(sdl12_compat VERSION 1.2.69 LANGUAGES C)
 
 option(SDL12TESTS "Enable to build SDL-1.2 test programs" ON)
 option(SDL12DEVEL "Enable installing SDL-1.2 development headers" ON)
diff --git a/build-scripts/build-release.py b/build-scripts/build-release.py
new file mode 100755
index 000000000..f3faa06c3
--- /dev/null
+++ b/build-scripts/build-release.py
@@ -0,0 +1,1556 @@
+#!/usr/bin/env python3
+
+"""
+This script is shared between SDL2, SDL3, and all satellite libraries.
+Don't specialize this script for doing project-specific modifications.
+Rather, modify release-info.json.
+"""
+
+import argparse
+import collections
+import dataclasses
+from collections.abc import Callable
+import contextlib
+import datetime
+import fnmatch
+import glob
+import io
+import json
+import logging
+import multiprocessing
+import os
+from pathlib import Path
+import platform
+import re
+import shlex
+import shutil
+import subprocess
+import sys
+import tarfile
+import tempfile
+import textwrap
+import typing
+import zipfile
+
+
+logger = logging.getLogger(__name__)
+GIT_HASH_FILENAME = ".git-hash"
+REVISION_TXT = "REVISION.txt"
+
+RE_ILLEGAL_MINGW_LIBRARIES = re.compile(r"(?:lib)?(?:gcc|(?:std)?c[+][+]|(?:win)?pthread).*", flags=re.I)
+
+
+def safe_isotime_to_datetime(str_isotime: str) -> datetime.datetime:
+    try:
+        return datetime.datetime.fromisoformat(str_isotime)
+    except ValueError:
+        pass
+    logger.warning("Invalid iso time: %s", str_isotime)
+    if str_isotime[-6:-5] in ("+", "-"):
+        # Commits can have isotime with invalid timezone offset (e.g. "2021-07-04T20:01:40+32:00")
+        modified_str_isotime = str_isotime[:-6] + "+00:00"
+        try:
+            return datetime.datetime.fromisoformat(modified_str_isotime)
+        except ValueError:
+            pass
+    raise ValueError(f"Inval

(Patch may be truncated, please check the link at the top of this post.)