From 67d47808c601d7190c084d76b289f6f4ca6d9515 Mon Sep 17 00:00:00 2001 From: m0nsky Date: Mon, 24 Aug 2026 20:32:31 +0200 Subject: [PATCH 1/2] Merge the minor and patch release workflows into one The two pairs were identical apart from their names once the version moved into LLamaSharp.csproj, so they are now a single release-trigger/release pair accepting either label. That also fixes labelling a PR with both labels, which used to release nothing because each trigger excluded the other's. --- .github/workflows/release-minor-trigger.yml | 19 ----- .github/workflows/release-patch-trigger.yml | 19 ----- .github/workflows/release-patch.yml | 80 ------------------- .github/workflows/release-trigger.yml | 22 +++++ .../{release-minor.yml => release.yml} | 6 +- 5 files changed, 25 insertions(+), 121 deletions(-) delete mode 100644 .github/workflows/release-minor-trigger.yml delete mode 100644 .github/workflows/release-patch-trigger.yml delete mode 100644 .github/workflows/release-patch.yml create mode 100644 .github/workflows/release-trigger.yml rename .github/workflows/{release-minor.yml => release.yml} (96%) diff --git a/.github/workflows/release-minor-trigger.yml b/.github/workflows/release-minor-trigger.yml deleted file mode 100644 index 161baa3f5..000000000 --- a/.github/workflows/release-minor-trigger.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: release-minor-trigger - -on: - pull_request: - branches: - - master - types: [ closed ] - -jobs: - release-minor-trigger: - if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'minor-release') && !contains(github.event.pull_request.labels.*.name, 'patch-release') - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v3 - - name: Setup .NET 6.0.x SDK - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 6.0.x diff --git a/.github/workflows/release-patch-trigger.yml b/.github/workflows/release-patch-trigger.yml deleted file mode 100644 index 18b511c33..000000000 --- a/.github/workflows/release-patch-trigger.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: release-patch-trigger - -on: - pull_request: - branches: - - master - types: [ closed ] - -jobs: - release-patch-trigger: - if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'patch-release') && !contains(github.event.pull_request.labels.*.name, 'minor-release') - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v3 - - name: Setup .NET 6.0.x SDK - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 6.0.x diff --git a/.github/workflows/release-patch.yml b/.github/workflows/release-patch.yml deleted file mode 100644 index 238bc67e9..000000000 --- a/.github/workflows/release-patch.yml +++ /dev/null @@ -1,80 +0,0 @@ -name: auto-patch-release - -on: - workflow_run: - workflows: ["release-patch-trigger"] - types: - - completed - -env: - NUGET_API_TOKEN: ${{ secrets.LLAMA_SHARP_NUGET_KEY_REPO }} - -jobs: - patch_release_to_nuget: - if: ${{ github.event.workflow_run.conclusion == 'success' }} - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v6 - - name: Configure Git Credentials - run: | - git config user.name Rinne - git config user.email AsakusaRinne@gmail.com - - name: Setup NuGet - uses: nuget/setup-nuget@v1 - with: - nuget-api-key: $NUGET_API_TOKEN - nuget-version: 'latest' - - - name: Check .NET info - run: dotnet --info - - - name: Install dependencies - run: dotnet restore - - - name: Build solution - run: | - dotnet build ./LLama/LLamaSharp.csproj -c Release --no-restore - - - name: Pack packages - run: | - git fetch --unshallow; - git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"; - git fetch origin; - - chmod +x ./.github/prepare_release.sh - ./.github/prepare_release.sh - - - name: Upload packages artifacts - uses: actions/upload-artifact@v4 - with: - name: "drop-ci-packages" - path: './temp' - - - name: Push LLamaSharp packages to nuget.org - run: dotnet nuget push ./temp/LLamaSharp*.nupkg --source https://www.nuget.org -k ${{ secrets.LLAMA_SHARP_NUGET_KEY_REPO }} --skip-duplicate - - # Deploy the documentation to GitHub Pages - - uses: actions/setup-python@v5 - with: - python-version: '3.13' - - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV - - uses: actions/cache@v4 - with: - key: mkdocs-material-${{ env.cache_id }} - path: .cache - restore-keys: | - mkdocs-material- - - run: pip install mkdocs==1.4.3 mkdocs-material mike==1.1.2 setuptools - - run: | - git fetch origin gh-pages --depth=1 - version=$(cat ./temp/version.txt) - mike deploy --push --update-aliases --force $version latest - mike set-default --push --force latest - - # Upload the native binaries to huggingface (experimental) - - name: Upload native binaries to huggingface - run: | - pip install huggingface_hub - llama_cpp_commit_hash=$(git submodule status llama.cpp | cut -c 2-7) - python .github/upload_to_hf.py --token ${{ secrets.HUGGINGFACE_TOKEN }} --revision $llama_cpp_commit_hash --folder LLama/runtimes \ No newline at end of file diff --git a/.github/workflows/release-trigger.yml b/.github/workflows/release-trigger.yml new file mode 100644 index 000000000..e69373dd3 --- /dev/null +++ b/.github/workflows/release-trigger.yml @@ -0,0 +1,22 @@ +name: release-trigger + +on: + pull_request: + branches: + - master + types: [ closed ] + +jobs: + release-trigger: + # Both labels mean the same thing here: the version to publish is read from + # LLama/LLamaSharp.csproj, so they only document the intent of the release. + if: >- + github.event.pull_request.merged == true && + (contains(github.event.pull_request.labels.*.name, 'minor-release') || + contains(github.event.pull_request.labels.*.name, 'patch-release')) + runs-on: ubuntu-22.04 + + steps: + # This job does no work. It exists so that "release" has a successful workflow run + # to fire from, which is what gates the release on the PR labels above. + - run: echo "Release triggered by PR #${{ github.event.pull_request.number }}" diff --git a/.github/workflows/release-minor.yml b/.github/workflows/release.yml similarity index 96% rename from .github/workflows/release-minor.yml rename to .github/workflows/release.yml index d1ef48a13..632315ad1 100644 --- a/.github/workflows/release-minor.yml +++ b/.github/workflows/release.yml @@ -1,8 +1,8 @@ -name: auto-minor-release +name: auto-release on: workflow_run: - workflows: ["release-minor-trigger"] + workflows: ["release-trigger"] types: - completed @@ -10,7 +10,7 @@ env: NUGET_API_TOKEN: ${{ secrets.LLAMA_SHARP_NUGET_KEY_REPO }} jobs: - minor_release_to_nuget: + release_to_nuget: if: ${{ github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-22.04 From 1f76f9902be56dabcbe357b0ea427dea5f995486 Mon Sep 17 00:00:00 2001 From: m0nsky Date: Mon, 24 Aug 2026 20:49:48 +0200 Subject: [PATCH 2/2] fix comment Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .github/workflows/release-trigger.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-trigger.yml b/.github/workflows/release-trigger.yml index e69373dd3..e6ecbd123 100644 --- a/.github/workflows/release-trigger.yml +++ b/.github/workflows/release-trigger.yml @@ -17,6 +17,6 @@ jobs: runs-on: ubuntu-22.04 steps: - # This job does no work. It exists so that "release" has a successful workflow run + # This job does no work. It exists so that "auto-release" has a successful workflow run # to fire from, which is what gates the release on the PR labels above. - run: echo "Release triggered by PR #${{ github.event.pull_request.number }}"