From 29b3c14619df80335edd68b5902aecb2fd0e9f04 Mon Sep 17 00:00:00 2001 From: jianlins Date: Wed, 11 Mar 2026 21:44:36 -0600 Subject: [PATCH] workflow: update build configurations for Linux and Windows CUDA --- .github/workflows/custom_build_rockylinux.yml | 260 ++++++------- .github/workflows/custom_build_wincuda.yml | 354 +++++++++--------- .github/workflows/syn_upstream.yml | 80 ++-- 3 files changed, 347 insertions(+), 347 deletions(-) diff --git a/.github/workflows/custom_build_rockylinux.yml b/.github/workflows/custom_build_rockylinux.yml index 8ba3861eb1..a025f141ce 100644 --- a/.github/workflows/custom_build_rockylinux.yml +++ b/.github/workflows/custom_build_rockylinux.yml @@ -1,130 +1,130 @@ -name: build-linux-cuda - -on: - release: - types: [published] - -permissions: - contents: write - -jobs: - build-linux-cuda: - runs-on: ubuntu-latest - - container: - image: nvidia/cuda:12.8.0-devel-rockylinux8 - - env: - BUILD_TYPE: Release - ARCHIVE_BASENAME: llama-bin-linux-cuda-12.8-rockylinux8 - - steps: - - name: Install build dependencies - shell: bash - run: | - set -euxo pipefail - yum -y update - yum -y install \ - git \ - cmake \ - gcc \ - gcc-c++ \ - make \ - ninja-build \ - tar \ - gzip \ - zip \ - findutils \ - file \ - which - yum clean all - - - name: Checkout source at release tag - uses: actions/checkout@v4 - with: - ref: ${{ github.event.release.tag_name }} - submodules: recursive - fetch-depth: 0 - - - name: Show build environment - shell: bash - run: | - set -euxo pipefail - cat /etc/os-release || true - uname -a - gcc --version - g++ --version - cmake --version - nvcc --version - - - name: Configure - shell: bash - run: | - set -euxo pipefail - cmake -S . -B build \ - -G Ninja \ - -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ - -DGGML_CUDA=ON \ - -DCMAKE_CUDA_COMPILER=$(command -v nvcc) - - - name: Build - shell: bash - run: | - set -euxo pipefail - cmake --build build --config ${BUILD_TYPE} -j"$(nproc)" - - - name: Prepare release payload - shell: bash - run: | - set -euxo pipefail - - TAG="${{ github.event.release.tag_name }}" - OUTDIR="${ARCHIVE_BASENAME}-${TAG}" - mkdir -p "${OUTDIR}/bin" "${OUTDIR}/lib" "${OUTDIR}/meta" - - if [[ -d build/bin ]]; then - find build/bin -maxdepth 1 -type f \( -name 'llama-*' -o -name 'ggml-*' \) -exec cp -av {} "${OUTDIR}/bin/" \; - fi - - find build -maxdepth 3 -type f \( -name 'libllama*' -o -name 'libggml*' \) -exec cp -av {} "${OUTDIR}/lib/" \; || true - - git rev-parse HEAD > "${OUTDIR}/meta/git-commit.txt" - git describe --tags --always > "${OUTDIR}/meta/git-describe.txt" || true - cat /etc/os-release > "${OUTDIR}/meta/os-release.txt" || true - gcc --version > "${OUTDIR}/meta/gcc-version.txt" - g++ --version > "${OUTDIR}/meta/gxx-version.txt" - cmake --version > "${OUTDIR}/meta/cmake-version.txt" - nvcc --version > "${OUTDIR}/meta/nvcc-version.txt" - - if compgen -G "${OUTDIR}/bin/*" > /dev/null; then - file "${OUTDIR}"/bin/* > "${OUTDIR}/meta/file-bin.txt" || true - ldd "${OUTDIR}"/bin/* > "${OUTDIR}/meta/ldd-bin.txt" || true - fi - - if compgen -G "${OUTDIR}/lib/*" > /dev/null; then - file "${OUTDIR}"/lib/* > "${OUTDIR}/meta/file-lib.txt" || true - ldd "${OUTDIR}"/lib/* > "${OUTDIR}/meta/ldd-lib.txt" || true - fi - - tar -czf "${OUTDIR}.tar.gz" "${OUTDIR}" - sha256sum "${OUTDIR}.tar.gz" > "${OUTDIR}.tar.gz.sha256" - - - name: Upload tarball to release - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ github.event.release.upload_url }} - asset_path: ./llama-bin-linux-cuda-12.8-rockylinux8-${{ github.event.release.tag_name }}.tar.gz - asset_name: llama-bin-linux-cuda-12.8-rockylinux8-${{ github.event.release.tag_name }}.tar.gz - asset_content_type: application/gzip - - - name: Upload checksum to release - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ github.event.release.upload_url }} - asset_path: ./llama-bin-linux-cuda-12.8-rockylinux8-${{ github.event.release.tag_name }}.tar.gz.sha256 - asset_name: llama-bin-linux-cuda-12.8-rockylinux8-${{ github.event.release.tag_name }}.tar.gz.sha256 - asset_content_type: text/plain +name: build-linux-cuda + +on: + release: + types: [published] + +permissions: + contents: write + +jobs: + build-linux-cuda: + runs-on: ubuntu-latest + + container: + image: nvidia/cuda:12.8.0-devel-rockylinux8 + + env: + BUILD_TYPE: Release + ARCHIVE_BASENAME: llama-bin-linux-cuda-12.8-rockylinux8 + + steps: + - name: Install build dependencies + shell: bash + run: | + set -euxo pipefail + yum -y update + yum -y install \ + git \ + cmake \ + gcc \ + gcc-c++ \ + make \ + ninja-build \ + tar \ + gzip \ + zip \ + findutils \ + file \ + which + yum clean all + + - name: Checkout source at release tag + uses: actions/checkout@v4 + with: + ref: ${{ github.event.release.tag_name }} + submodules: recursive + fetch-depth: 0 + + - name: Show build environment + shell: bash + run: | + set -euxo pipefail + cat /etc/os-release || true + uname -a + gcc --version + g++ --version + cmake --version + nvcc --version + + - name: Configure + shell: bash + run: | + set -euxo pipefail + cmake -S . -B build \ + -G Ninja \ + -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ + -DGGML_CUDA=ON \ + -DCMAKE_CUDA_COMPILER=$(command -v nvcc) + + - name: Build + shell: bash + run: | + set -euxo pipefail + cmake --build build --config ${BUILD_TYPE} -j"$(nproc)" + + - name: Prepare release payload + shell: bash + run: | + set -euxo pipefail + + TAG="${{ github.event.release.tag_name }}" + OUTDIR="${ARCHIVE_BASENAME}-${TAG}" + mkdir -p "${OUTDIR}/bin" "${OUTDIR}/lib" "${OUTDIR}/meta" + + if [[ -d build/bin ]]; then + find build/bin -maxdepth 1 -type f \( -name 'llama-*' -o -name 'ggml-*' \) -exec cp -av {} "${OUTDIR}/bin/" \; + fi + + find build -maxdepth 3 -type f \( -name 'libllama*' -o -name 'libggml*' \) -exec cp -av {} "${OUTDIR}/lib/" \; || true + + git rev-parse HEAD > "${OUTDIR}/meta/git-commit.txt" + git describe --tags --always > "${OUTDIR}/meta/git-describe.txt" || true + cat /etc/os-release > "${OUTDIR}/meta/os-release.txt" || true + gcc --version > "${OUTDIR}/meta/gcc-version.txt" + g++ --version > "${OUTDIR}/meta/gxx-version.txt" + cmake --version > "${OUTDIR}/meta/cmake-version.txt" + nvcc --version > "${OUTDIR}/meta/nvcc-version.txt" + + if compgen -G "${OUTDIR}/bin/*" > /dev/null; then + file "${OUTDIR}"/bin/* > "${OUTDIR}/meta/file-bin.txt" || true + ldd "${OUTDIR}"/bin/* > "${OUTDIR}/meta/ldd-bin.txt" || true + fi + + if compgen -G "${OUTDIR}/lib/*" > /dev/null; then + file "${OUTDIR}"/lib/* > "${OUTDIR}/meta/file-lib.txt" || true + ldd "${OUTDIR}"/lib/* > "${OUTDIR}/meta/ldd-lib.txt" || true + fi + + tar -czf "${OUTDIR}.tar.gz" "${OUTDIR}" + sha256sum "${OUTDIR}.tar.gz" > "${OUTDIR}.tar.gz.sha256" + + - name: Upload tarball to release + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./llama-bin-linux-cuda-12.8-rockylinux8-${{ github.event.release.tag_name }}.tar.gz + asset_name: llama-bin-linux-cuda-12.8-rockylinux8-${{ github.event.release.tag_name }}.tar.gz + asset_content_type: application/gzip + + - name: Upload checksum to release + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./llama-bin-linux-cuda-12.8-rockylinux8-${{ github.event.release.tag_name }}.tar.gz.sha256 + asset_name: llama-bin-linux-cuda-12.8-rockylinux8-${{ github.event.release.tag_name }}.tar.gz.sha256 + asset_content_type: text/plain diff --git a/.github/workflows/custom_build_wincuda.yml b/.github/workflows/custom_build_wincuda.yml index 30d88c87ba..9791726399 100644 --- a/.github/workflows/custom_build_wincuda.yml +++ b/.github/workflows/custom_build_wincuda.yml @@ -1,177 +1,177 @@ -name: custom_build_wincuda - -on: - workflow_dispatch: # allows manual triggering - inputs: - create_release: - description: 'Create new release' - required: true - type: boolean - cuda: - description: 'cuda version used to build. For available versions, check https://github.com/Jimver/cuda-toolkit/blob/master/src/links/windows-links.ts' - required: false - type: string - default: '12.6.2' - gpu_arch: - description: 'nvidia gpu arch numbers' - required: false - type: string - default: '70;75;80;86' - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }} - cancel-in-progress: true - -permissions: - contents: write - -env: - BRANCH_NAME: ${{ github.head_ref || github.ref_name }} - GGML_NLOOP: 3 - GGML_N_THREADS: 1 - LLAMA_LOG_COLORS: 1 - LLAMA_LOG_PREFIX: 1 - LLAMA_LOG_TIMESTAMPS: 1 - -jobs: - - - windows-latest-cmake-cuda: - runs-on: windows-latest - - steps: - - name: Clone - id: checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Get Python - uses: actions/setup-python@v2 - with: - python-version: 3.8.10 - - - name: Install python dependencies - run: | - python -m pip install --upgrade pip - pip install customtkinter==5.2.0 pyinstaller==5.11.0 psutil==5.9.5 - - - name: Download and install win64devkit - run: | - curl -L https://github.com/skeeto/w64devkit/releases/download/v1.22.0/w64devkit-1.22.0.zip --output w64devkit.zip - Expand-Archive w64devkit.zip -DestinationPath . - - - name: Add w64devkit to PATH - run: | - echo "$(Get-Location)\w64devkit\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 - - - name: Print System Environment Variables - id: printvars - run: | - echo "Number of processors: ${env:NUMBER_OF_PROCESSORS}" - echo "Processor Architecture: ${env:PROCESSOR_ARCHITECTURE}" - echo "Computer Name: ${env:COMPUTERNAME}" - wmic cpu get name - wmic os get TotalVisibleMemorySize, FreePhysicalMemory - - - uses: Jimver/cuda-toolkit@v0.2.19 - id: cuda-toolkit - with: - cuda: ${{ github.event.inputs.cuda }} - - - - name: Install ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: - key: ${{ github.job }}-cuda${{ github.event.inputs.cuda }} - - - name: Build - id: cmake_build - run: | - mkdir build - cd build - cmake .. -DGGML_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES="${{ github.event.inputs.gpu_arch }}" -DCMAKE_SYSTEM_VERSION="10.0.19041.0" - cmake --build . --config Release -j 2 - - - name: Determine tag name - id: tag - shell: bash - run: | - BUILD_NUMBER="$(git rev-list --count HEAD)" - SHORT_HASH="$(git rev-parse --short=7 HEAD)" - if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then - echo "name=b${BUILD_NUMBER}-${{ github.event.inputs.cuda }}" >> $GITHUB_OUTPUT - else - SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-') - echo "name=WinFull-${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}-${{ github.event.inputs.cuda }}" >> $GITHUB_OUTPUT - fi - - - name: Pack artifacts - id: pack_artifacts - if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }} - run: | - 7z a llama-${{ steps.tag.outputs.name }}-bin-win-cu${{ github.event.inputs.cuda }}-x64.zip .\build\bin\Release\* - - - name: Upload artifacts - if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }} - uses: actions/upload-artifact@v4 - with: - path: llama-${{ steps.tag.outputs.name }}-bin-win-cu${{ github.event.inputs.cuda }}-x64.zip - name: llama-bin-win-cu${{ github.event.inputs.cuda }}-x64.zip - - - name: Copy and pack Cuda runtime - run: | - echo "Cuda install location: ${{ env.CUDA_PATH }}" - $dst='.\build\bin\cudart\' - robocopy "${{env.CUDA_PATH}}\bin" $dst cudart64_*.dll cublas64_*.dll cublasLt64_*.dll - robocopy "${{env.CUDA_PATH}}\lib" $dst cudart64_*.dll cublas64_*.dll cublasLt64_*.dll - 7z a cudart-llama-bin-win-cu${{ github.event.inputs.cuda }}-x64.zip $dst\* - - - name: Upload Cuda runtime - if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }} - uses: actions/upload-artifact@v4 - with: - path: cudart-llama-bin-win-cu${{ github.event.inputs.cuda }}-x64.zip - name: cudart-llama-bin-win-cu${{ github.event.inputs.cuda }}-x64.zip - - - name: Download artifacts - id: download-artifact - uses: actions/download-artifact@v4 - with: - path: ./artifact - - - name: Move artifacts - id: move_artifacts - run: mkdir -p ./artifact/release && mv ./artifact/*/*.zip ./artifact/release - - - name: Create release - id: create_release - if: ${{ github.event.inputs.create_release == 'true' }} - uses: anzz1/action-create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ steps.tag.outputs.name }} - - - name: Upload release - id: upload_release - if: ${{ github.event.inputs.create_release == 'true' }} - uses: actions/github-script@v3 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - const path = require('path'); - const fs = require('fs'); - const release_id = '${{ steps.create_release.outputs.id }}'; - for (let file of await fs.readdirSync('./artifact/release')) { - if (path.extname(file) === '.zip') { - console.log('uploadReleaseAsset', file); - await github.repos.uploadReleaseAsset({ - owner: context.repo.owner, - repo: context.repo.repo, - release_id: release_id, - name: file, - data: await fs.readFileSync(`./artifact/release/${file}`) - }); - } - } +name: custom_build_wincuda + +on: + workflow_dispatch: # allows manual triggering + inputs: + create_release: + description: 'Create new release' + required: true + type: boolean + cuda: + description: 'cuda version used to build. For available versions, check https://github.com/Jimver/cuda-toolkit/blob/master/src/links/windows-links.ts' + required: false + type: string + default: '12.6.2' + gpu_arch: + description: 'nvidia gpu arch numbers' + required: false + type: string + default: '70;75;80;86' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: write + +env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + GGML_NLOOP: 3 + GGML_N_THREADS: 1 + LLAMA_LOG_COLORS: 1 + LLAMA_LOG_PREFIX: 1 + LLAMA_LOG_TIMESTAMPS: 1 + +jobs: + + + windows-latest-cmake-cuda: + runs-on: windows-latest + + steps: + - name: Clone + id: checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get Python + uses: actions/setup-python@v2 + with: + python-version: 3.8.10 + + - name: Install python dependencies + run: | + python -m pip install --upgrade pip + pip install customtkinter==5.2.0 pyinstaller==5.11.0 psutil==5.9.5 + + - name: Download and install win64devkit + run: | + curl -L https://github.com/skeeto/w64devkit/releases/download/v1.22.0/w64devkit-1.22.0.zip --output w64devkit.zip + Expand-Archive w64devkit.zip -DestinationPath . + + - name: Add w64devkit to PATH + run: | + echo "$(Get-Location)\w64devkit\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 + + - name: Print System Environment Variables + id: printvars + run: | + echo "Number of processors: ${env:NUMBER_OF_PROCESSORS}" + echo "Processor Architecture: ${env:PROCESSOR_ARCHITECTURE}" + echo "Computer Name: ${env:COMPUTERNAME}" + wmic cpu get name + wmic os get TotalVisibleMemorySize, FreePhysicalMemory + + - uses: Jimver/cuda-toolkit@v0.2.19 + id: cuda-toolkit + with: + cuda: ${{ github.event.inputs.cuda }} + + + - name: Install ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: ${{ github.job }}-cuda${{ github.event.inputs.cuda }} + + - name: Build + id: cmake_build + run: | + mkdir build + cd build + cmake .. -DGGML_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES="${{ github.event.inputs.gpu_arch }}" -DCMAKE_SYSTEM_VERSION="10.0.19041.0" + cmake --build . --config Release -j 2 + + - name: Determine tag name + id: tag + shell: bash + run: | + BUILD_NUMBER="$(git rev-list --count HEAD)" + SHORT_HASH="$(git rev-parse --short=7 HEAD)" + if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then + echo "name=b${BUILD_NUMBER}-${{ github.event.inputs.cuda }}" >> $GITHUB_OUTPUT + else + SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-') + echo "name=WinFull-${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}-${{ github.event.inputs.cuda }}" >> $GITHUB_OUTPUT + fi + + - name: Pack artifacts + id: pack_artifacts + if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }} + run: | + 7z a llama-${{ steps.tag.outputs.name }}-bin-win-cu${{ github.event.inputs.cuda }}-x64.zip .\build\bin\Release\* + + - name: Upload artifacts + if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }} + uses: actions/upload-artifact@v4 + with: + path: llama-${{ steps.tag.outputs.name }}-bin-win-cu${{ github.event.inputs.cuda }}-x64.zip + name: llama-bin-win-cu${{ github.event.inputs.cuda }}-x64.zip + + - name: Copy and pack Cuda runtime + run: | + echo "Cuda install location: ${{ env.CUDA_PATH }}" + $dst='.\build\bin\cudart\' + robocopy "${{env.CUDA_PATH}}\bin" $dst cudart64_*.dll cublas64_*.dll cublasLt64_*.dll + robocopy "${{env.CUDA_PATH}}\lib" $dst cudart64_*.dll cublas64_*.dll cublasLt64_*.dll + 7z a cudart-llama-bin-win-cu${{ github.event.inputs.cuda }}-x64.zip $dst\* + + - name: Upload Cuda runtime + if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }} + uses: actions/upload-artifact@v4 + with: + path: cudart-llama-bin-win-cu${{ github.event.inputs.cuda }}-x64.zip + name: cudart-llama-bin-win-cu${{ github.event.inputs.cuda }}-x64.zip + + - name: Download artifacts + id: download-artifact + uses: actions/download-artifact@v4 + with: + path: ./artifact + + - name: Move artifacts + id: move_artifacts + run: mkdir -p ./artifact/release && mv ./artifact/*/*.zip ./artifact/release + + - name: Create release + id: create_release + if: ${{ github.event.inputs.create_release == 'true' }} + uses: anzz1/action-create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ steps.tag.outputs.name }} + + - name: Upload release + id: upload_release + if: ${{ github.event.inputs.create_release == 'true' }} + uses: actions/github-script@v3 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + const path = require('path'); + const fs = require('fs'); + const release_id = '${{ steps.create_release.outputs.id }}'; + for (let file of await fs.readdirSync('./artifact/release')) { + if (path.extname(file) === '.zip') { + console.log('uploadReleaseAsset', file); + await github.repos.uploadReleaseAsset({ + owner: context.repo.owner, + repo: context.repo.repo, + release_id: release_id, + name: file, + data: await fs.readFileSync(`./artifact/release/${file}`) + }); + } + } diff --git a/.github/workflows/syn_upstream.yml b/.github/workflows/syn_upstream.yml index 5925f5cc38..683e6d0a0f 100644 --- a/.github/workflows/syn_upstream.yml +++ b/.github/workflows/syn_upstream.yml @@ -1,40 +1,40 @@ -name: Sync Upstream - -on: - schedule: - - cron: '0 0 * * 0' # Every Sunday at midnight - -jobs: - merge: - runs-on: ubuntu-latest - steps: - - name: Checkout master branch - uses: actions/checkout@v2 - with: - ref: master - - - name: Merge upstream master - id: merge - run: | - git remote add upstream https://github.com/ggml-org/repository.git - git fetch upstream - if git merge upstream/master; then - echo "merge_success=true" >> $GITHUB_OUTPUT - else - echo "merge_success=false" >> $GITHUB_OUTPUT - echo "Automatic merge failed. Skipping push." - exit 0 - fi - - - name: Push changes - if: steps.merge.outputs.merge_success == 'true' - run: | - # Check if there are any changes - if git diff --quiet HEAD@{1} HEAD; then - echo "No changes to push" - else - echo "Changes detected, pushing updates..." - git push origin master - fi - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file +name: Sync Upstream + +on: + schedule: + - cron: '0 0 * * 0' # Every Sunday at midnight + +jobs: + merge: + runs-on: ubuntu-latest + steps: + - name: Checkout master branch + uses: actions/checkout@v2 + with: + ref: master + + - name: Merge upstream master + id: merge + run: | + git remote add upstream https://github.com/ggml-org/repository.git + git fetch upstream + if git merge upstream/master; then + echo "merge_success=true" >> $GITHUB_OUTPUT + else + echo "merge_success=false" >> $GITHUB_OUTPUT + echo "Automatic merge failed. Skipping push." + exit 0 + fi + + - name: Push changes + if: steps.merge.outputs.merge_success == 'true' + run: | + # Check if there are any changes + if git diff --quiet HEAD@{1} HEAD; then + echo "No changes to push" + else + echo "Changes detected, pushing updates..." + git push origin master + fi + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}