From fd7b19a19a4cb30194f93046c7d9d9dc0cb48110 Mon Sep 17 00:00:00 2001 From: johndoe6345789 Date: Fri, 19 Dec 2025 19:13:43 +0000 Subject: [PATCH 1/4] Create workflow.patch --- workflow.patch | 206 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 206 insertions(+) create mode 100644 workflow.patch diff --git a/workflow.patch b/workflow.patch new file mode 100644 index 0000000..8353c05 --- /dev/null +++ b/workflow.patch @@ -0,0 +1,206 @@ +diff --git a/.github/workflows/package-release.yml b/.github/workflows/package-release.yml +index 0000000..0000000 100644 +--- a/.github/workflows/package-release.yml ++++ b/.github/workflows/package-release.yml +@@ -3,13 +3,13 @@ name: Package Release + on: + workflow_call: + + permissions: +- contents: read ++ contents: write + packages: write + + jobs: + package-release: + strategy: + fail-fast: false + matrix: + include: + - name: linux-amd64 + runner: ubuntu-24.04 + platform: linux + arch: amd64 + - name: linux-arm64 + runner: ubuntu-24.04-arm64 + platform: linux + arch: arm64 + runs-on: ${{ matrix.runner }} + env: + BUILD_DIR: build/${{ matrix.platform }}-${{ matrix.arch }} + ZIP_NAME: sdl3_app-${{ matrix.platform }}-${{ matrix.arch }}.zip + PLATFORM_NAME: ${{ matrix.platform }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Download build artifact + uses: actions/download-artifact@v4 + with: + name: build-${{ matrix.platform }}-${{ matrix.arch }} + path: . +- run-id: ${{ github.run_id }} + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + + - name: Package release ZIP + run: python scripts/package_release.py + + - name: Publish GitHub release asset + if: github.ref != 'refs/tags/local' + uses: softprops/action-gh-release@v1 + with: + files: release/${{ env.ZIP_NAME }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +diff --git a/.github/workflows/publish-container.yml b/.github/workflows/publish-container.yml +index 0000000..0000000 100644 +--- a/.github/workflows/publish-container.yml ++++ b/.github/workflows/publish-container.yml +@@ -1,49 +1,60 @@ + name: Publish Container Image + + on: + workflow_call: + + permissions: + contents: read + packages: write + + jobs: + publish-image: + strategy: + fail-fast: false + matrix: + include: + - name: linux-amd64 + platform: linux + arch: amd64 + - name: linux-arm64 + platform: linux + arch: arm64 + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: linux/amd64,linux/arm64 + ++ - name: Set up Docker Buildx ++ uses: docker/setup-buildx-action@v3 ++ + - name: Log in to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + +- - name: Build and publish container image +- run: | +- docker build \ +- --build-arg USERNAME=builder \ +- --build-arg UID=$(id -u) \ +- --build-arg GID=$(id -g) \ +- -f .github/workflows/Dockerfile \ +- -t sdl3_app:${{ matrix.platform }}-${{ matrix.arch }} . +- IMAGE=ghcr.io/${{ github.repository_owner }}/sdl3_app:${{ matrix.platform }}-${{ matrix.arch }} +- docker tag sdl3_app:${{ matrix.platform }}-${{ matrix.arch }} "$IMAGE" +- docker push "$IMAGE" ++ - name: Build and publish container image ++ uses: docker/build-push-action@v5 ++ with: ++ context: . ++ file: .github/workflows/Dockerfile ++ push: true ++ platforms: linux/${{ matrix.arch }} ++ tags: ghcr.io/${{ github.repository_owner }}/sdl3_app:${{ matrix.platform }}-${{ matrix.arch }} ++ build-args: | ++ USERNAME=builder ++ UID=1000 ++ GID=1000 +diff --git a/.github/workflows/upload-build-artifact.yml b/.github/workflows/upload-build-artifact.yml +index 0000000..0000000 100644 +--- a/.github/workflows/upload-build-artifact.yml ++++ b/.github/workflows/upload-build-artifact.yml +@@ -1,63 +1,73 @@ + name: Upload Build Artifacts + + on: + workflow_call: + + permissions: + contents: write + + jobs: + upload-artifact: + strategy: + fail-fast: false + matrix: + include: + - name: linux-amd64 + platform: linux + arch: amd64 + - name: linux-arm64 + platform: linux + arch: arm64 + runs-on: ubuntu-24.04 + env: + BUILD_DIR: build/${{ matrix.platform }}-${{ matrix.arch }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + with: + platforms: linux/amd64,linux/arm64 ++ ++ - name: Set up Docker Buildx ++ uses: docker/setup-buildx-action@v3 + + - name: Build linux container image + if: matrix.platform == 'linux' + run: | +- docker build \ +- --build-arg USERNAME=builder \ +- --build-arg UID=$(id -u) \ +- --build-arg GID=$(id -g) \ +- -f .github/workflows/Dockerfile \ +- -t sdl3_app:${{ matrix.platform }}-${{ matrix.arch }} . ++ docker buildx build \ ++ --platform linux/${{ matrix.arch }} \ ++ --load \ ++ --build-arg USERNAME=builder \ ++ --build-arg UID=$(id -u) \ ++ --build-arg GID=$(id -g) \ ++ -f .github/workflows/Dockerfile \ ++ -t sdl3_app:${{ matrix.platform }}-${{ matrix.arch }} . + + - name: Run linux build in container + if: matrix.platform == 'linux' + env: + BUILD_DIR: ${{ env.BUILD_DIR }} + run: | + docker run --rm \ + -e BUILD_DIR \ + -w /workspace \ + -v "${{ github.workspace }}:/workspace" \ + sdl3_app:${{ matrix.platform }}-${{ matrix.arch }} \ + bash -c 'set -euo pipefail + if [ -d "$BUILD_DIR" ]; then rm -rf "$BUILD_DIR"; fi + cp -a /conan_build "$BUILD_DIR" + cmake -S . -B "$BUILD_DIR" -DCMAKE_BUILD_TYPE=Release + cmake --build "$BUILD_DIR" --config Release' + + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: build-${{ matrix.platform }}-${{ matrix.arch }} + path: ${{ env.BUILD_DIR }} From 26c0e1b0e92bda7225c446dec62ae68021172f0c Mon Sep 17 00:00:00 2001 From: johndoe6345789 Date: Fri, 19 Dec 2025 19:29:17 +0000 Subject: [PATCH 2/4] Update workflow.patch --- workflow.patch | 153 +++++-------------------------------------------- 1 file changed, 14 insertions(+), 139 deletions(-) diff --git a/workflow.patch b/workflow.patch index 8353c05..a6ae968 100644 --- a/workflow.patch +++ b/workflow.patch @@ -1,9 +1,8 @@ diff --git a/.github/workflows/package-release.yml b/.github/workflows/package-release.yml -index 0000000..0000000 100644 +index 518ddf2..1c0e350 100644 --- a/.github/workflows/package-release.yml +++ b/.github/workflows/package-release.yml -@@ -3,13 +3,13 @@ name: Package Release - on: +@@ -4,7 +4,7 @@ on: workflow_call: permissions: @@ -12,30 +11,7 @@ index 0000000..0000000 100644 packages: write jobs: - package-release: - strategy: - fail-fast: false - matrix: - include: - - name: linux-amd64 - runner: ubuntu-24.04 - platform: linux - arch: amd64 - - name: linux-arm64 - runner: ubuntu-24.04-arm64 - platform: linux - arch: arm64 - runs-on: ${{ matrix.runner }} - env: - BUILD_DIR: build/${{ matrix.platform }}-${{ matrix.arch }} - ZIP_NAME: sdl3_app-${{ matrix.platform }}-${{ matrix.arch }}.zip - PLATFORM_NAME: ${{ matrix.platform }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Download build artifact - uses: actions/download-artifact@v4 +@@ -35,7 +35,6 @@ jobs: with: name: build-${{ matrix.platform }}-${{ matrix.arch }} path: . @@ -43,52 +19,11 @@ index 0000000..0000000 100644 - name: Set up Python uses: actions/setup-python@v5 - with: - python-version: '3.x' - - - name: Package release ZIP - run: python scripts/package_release.py - - - name: Publish GitHub release asset - if: github.ref != 'refs/tags/local' - uses: softprops/action-gh-release@v1 - with: - files: release/${{ env.ZIP_NAME }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/publish-container.yml b/.github/workflows/publish-container.yml -index 0000000..0000000 100644 +index c88b120..172af16 100644 --- a/.github/workflows/publish-container.yml +++ b/.github/workflows/publish-container.yml -@@ -1,49 +1,60 @@ - name: Publish Container Image - - on: - workflow_call: - - permissions: - contents: read - packages: write - - jobs: - publish-image: - strategy: - fail-fast: false - matrix: - include: - - name: linux-amd64 - platform: linux - arch: amd64 - - name: linux-arm64 - platform: linux - arch: arm64 - runs-on: ubuntu-24.04 - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 +@@ -29,6 +29,9 @@ jobs: with: platforms: linux/amd64,linux/arm64 @@ -98,11 +33,10 @@ index 0000000..0000000 100644 - name: Log in to GitHub Container Registry uses: docker/login-action@v2 with: - registry: ghcr.io - username: ${{ github.actor }} +@@ -37,13 +40,14 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} -- - name: Build and publish container image + - name: Build and publish container image - run: | - docker build \ - --build-arg USERNAME=builder \ @@ -113,7 +47,6 @@ index 0000000..0000000 100644 - IMAGE=ghcr.io/${{ github.repository_owner }}/sdl3_app:${{ matrix.platform }}-${{ matrix.arch }} - docker tag sdl3_app:${{ matrix.platform }}-${{ matrix.arch }} "$IMAGE" - docker push "$IMAGE" -+ - name: Build and publish container image + uses: docker/build-push-action@v5 + with: + context: . @@ -126,81 +59,23 @@ index 0000000..0000000 100644 + UID=1000 + GID=1000 diff --git a/.github/workflows/upload-build-artifact.yml b/.github/workflows/upload-build-artifact.yml -index 0000000..0000000 100644 +index d6135e2..1ee901c 100644 --- a/.github/workflows/upload-build-artifact.yml +++ b/.github/workflows/upload-build-artifact.yml -@@ -1,63 +1,73 @@ - name: Upload Build Artifacts - - on: - workflow_call: - - permissions: - contents: write - - jobs: - upload-artifact: - strategy: - fail-fast: false - matrix: - include: - - name: linux-amd64 - platform: linux - arch: amd64 - - name: linux-arm64 - platform: linux - arch: arm64 - runs-on: ubuntu-24.04 - env: - BUILD_DIR: build/${{ matrix.platform }}-${{ matrix.arch }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 +@@ -30,10 +30,15 @@ jobs: with: platforms: linux/amd64,linux/arm64 -+ + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - ++ - name: Build linux container image if: matrix.platform == 'linux' run: | - docker build \ -- --build-arg USERNAME=builder \ -- --build-arg UID=$(id -u) \ -- --build-arg GID=$(id -g) \ -- -f .github/workflows/Dockerfile \ -- -t sdl3_app:${{ matrix.platform }}-${{ matrix.arch }} . + docker buildx build \ + --platform linux/${{ matrix.arch }} \ + --load \ -+ --build-arg USERNAME=builder \ -+ --build-arg UID=$(id -u) \ -+ --build-arg GID=$(id -g) \ -+ -f .github/workflows/Dockerfile \ -+ -t sdl3_app:${{ matrix.platform }}-${{ matrix.arch }} . - - - name: Run linux build in container - if: matrix.platform == 'linux' - env: - BUILD_DIR: ${{ env.BUILD_DIR }} - run: | - docker run --rm \ - -e BUILD_DIR \ - -w /workspace \ - -v "${{ github.workspace }}:/workspace" \ - sdl3_app:${{ matrix.platform }}-${{ matrix.arch }} \ - bash -c 'set -euo pipefail - if [ -d "$BUILD_DIR" ]; then rm -rf "$BUILD_DIR"; fi - cp -a /conan_build "$BUILD_DIR" - cmake -S . -B "$BUILD_DIR" -DCMAKE_BUILD_TYPE=Release - cmake --build "$BUILD_DIR" --config Release' - - - name: Upload build artifact - uses: actions/upload-artifact@v4 - with: - name: build-${{ matrix.platform }}-${{ matrix.arch }} - path: ${{ env.BUILD_DIR }} + --build-arg USERNAME=builder \ + --build-arg UID=$(id -u) \ + --build-arg GID=$(id -g) \ From efc115c936cb5aa098fc6560283c292c7760fbf6 Mon Sep 17 00:00:00 2001 From: johndoe6345789 Date: Fri, 19 Dec 2025 19:31:47 +0000 Subject: [PATCH 3/4] upgrade workflow --- .github/workflows/package-release.yml | 3 +-- .github/workflows/publish-container.yml | 24 ++++++++++++--------- .github/workflows/upload-build-artifact.yml | 7 +++++- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/.github/workflows/package-release.yml b/.github/workflows/package-release.yml index 518ddf2..1c0e350 100644 --- a/.github/workflows/package-release.yml +++ b/.github/workflows/package-release.yml @@ -4,7 +4,7 @@ on: workflow_call: permissions: - contents: read + contents: write packages: write jobs: @@ -35,7 +35,6 @@ jobs: with: name: build-${{ matrix.platform }}-${{ matrix.arch }} path: . - run-id: ${{ github.run_id }} - name: Set up Python uses: actions/setup-python@v5 diff --git a/.github/workflows/publish-container.yml b/.github/workflows/publish-container.yml index c88b120..172af16 100644 --- a/.github/workflows/publish-container.yml +++ b/.github/workflows/publish-container.yml @@ -29,6 +29,9 @@ jobs: with: platforms: linux/amd64,linux/arm64 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to GitHub Container Registry uses: docker/login-action@v2 with: @@ -37,13 +40,14 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and publish container image - run: | - docker build \ - --build-arg USERNAME=builder \ - --build-arg UID=$(id -u) \ - --build-arg GID=$(id -g) \ - -f .github/workflows/Dockerfile \ - -t sdl3_app:${{ matrix.platform }}-${{ matrix.arch }} . - IMAGE=ghcr.io/${{ github.repository_owner }}/sdl3_app:${{ matrix.platform }}-${{ matrix.arch }} - docker tag sdl3_app:${{ matrix.platform }}-${{ matrix.arch }} "$IMAGE" - docker push "$IMAGE" + uses: docker/build-push-action@v5 + with: + context: . + file: .github/workflows/Dockerfile + push: true + platforms: linux/${{ matrix.arch }} + tags: ghcr.io/${{ github.repository_owner }}/sdl3_app:${{ matrix.platform }}-${{ matrix.arch }} + build-args: | + USERNAME=builder + UID=1000 + GID=1000 diff --git a/.github/workflows/upload-build-artifact.yml b/.github/workflows/upload-build-artifact.yml index d6135e2..1ee901c 100644 --- a/.github/workflows/upload-build-artifact.yml +++ b/.github/workflows/upload-build-artifact.yml @@ -30,10 +30,15 @@ jobs: with: platforms: linux/amd64,linux/arm64 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build linux container image if: matrix.platform == 'linux' run: | - docker build \ + docker buildx build \ + --platform linux/${{ matrix.arch }} \ + --load \ --build-arg USERNAME=builder \ --build-arg UID=$(id -u) \ --build-arg GID=$(id -g) \ From 36ce6c3533a5d452b9a626a16d85b1b420ae6a5d Mon Sep 17 00:00:00 2001 From: johndoe6345789 Date: Fri, 19 Dec 2025 19:35:38 +0000 Subject: [PATCH 4/4] remove patch --- workflow.patch | 81 -------------------------------------------------- 1 file changed, 81 deletions(-) delete mode 100644 workflow.patch diff --git a/workflow.patch b/workflow.patch deleted file mode 100644 index a6ae968..0000000 --- a/workflow.patch +++ /dev/null @@ -1,81 +0,0 @@ -diff --git a/.github/workflows/package-release.yml b/.github/workflows/package-release.yml -index 518ddf2..1c0e350 100644 ---- a/.github/workflows/package-release.yml -+++ b/.github/workflows/package-release.yml -@@ -4,7 +4,7 @@ on: - workflow_call: - - permissions: -- contents: read -+ contents: write - packages: write - - jobs: -@@ -35,7 +35,6 @@ jobs: - with: - name: build-${{ matrix.platform }}-${{ matrix.arch }} - path: . -- run-id: ${{ github.run_id }} - - - name: Set up Python - uses: actions/setup-python@v5 -diff --git a/.github/workflows/publish-container.yml b/.github/workflows/publish-container.yml -index c88b120..172af16 100644 ---- a/.github/workflows/publish-container.yml -+++ b/.github/workflows/publish-container.yml -@@ -29,6 +29,9 @@ jobs: - with: - platforms: linux/amd64,linux/arm64 - -+ - name: Set up Docker Buildx -+ uses: docker/setup-buildx-action@v3 -+ - - name: Log in to GitHub Container Registry - uses: docker/login-action@v2 - with: -@@ -37,13 +40,14 @@ jobs: - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and publish container image -- run: | -- docker build \ -- --build-arg USERNAME=builder \ -- --build-arg UID=$(id -u) \ -- --build-arg GID=$(id -g) \ -- -f .github/workflows/Dockerfile \ -- -t sdl3_app:${{ matrix.platform }}-${{ matrix.arch }} . -- IMAGE=ghcr.io/${{ github.repository_owner }}/sdl3_app:${{ matrix.platform }}-${{ matrix.arch }} -- docker tag sdl3_app:${{ matrix.platform }}-${{ matrix.arch }} "$IMAGE" -- docker push "$IMAGE" -+ uses: docker/build-push-action@v5 -+ with: -+ context: . -+ file: .github/workflows/Dockerfile -+ push: true -+ platforms: linux/${{ matrix.arch }} -+ tags: ghcr.io/${{ github.repository_owner }}/sdl3_app:${{ matrix.platform }}-${{ matrix.arch }} -+ build-args: | -+ USERNAME=builder -+ UID=1000 -+ GID=1000 -diff --git a/.github/workflows/upload-build-artifact.yml b/.github/workflows/upload-build-artifact.yml -index d6135e2..1ee901c 100644 ---- a/.github/workflows/upload-build-artifact.yml -+++ b/.github/workflows/upload-build-artifact.yml -@@ -30,10 +30,15 @@ jobs: - with: - platforms: linux/amd64,linux/arm64 - -+ - name: Set up Docker Buildx -+ uses: docker/setup-buildx-action@v3 -+ - - name: Build linux container image - if: matrix.platform == 'linux' - run: | -- docker build \ -+ docker buildx build \ -+ --platform linux/${{ matrix.arch }} \ -+ --load \ - --build-arg USERNAME=builder \ - --build-arg UID=$(id -u) \ - --build-arg GID=$(id -g) \