From: Daniel Bevenius Date: Wed, 25 Jun 2025 19:43:58 +0000 (+0200) Subject: ci : add support for tag-based releases (#3287) X-Git-Tag: upstream/1.7.6~42 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=4daf7050ca2bf17f5166f45ac6da651c4e33f293;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp ci : add support for tag-based releases (#3287) This commit modifies the GitHub Actions workflow to support tag-based releases. When a tag is pushed that starts with 'v', the workflow will use that tag name for the release process. I think this was the once the behavior, but it was lost in updates that I've made to the workflow. This commit restores that functionality. --- diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3568db32..48aa640a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,6 +4,8 @@ on: push: branches: - master + tags: + - 'v*' pull_request: types: [opened, synchronize, reopened] workflow_dispatch: @@ -62,8 +64,11 @@ jobs: echo "BRANCH_NAME: ${{ env.BRANCH_NAME }}" echo "CUSTOM_TAG: $CUSTOM_TAG" + if [[ "${{ github.ref_type }}" == "tag" ]]; then + echo "Using pushed tag name" + TAG_NAME="${{ github.ref_name }}" # Use custom tag if provided - if [[ -n "$CUSTOM_TAG" ]]; then + elif [[ -n "$CUSTOM_TAG" ]]; then echo "Using custom tag" TAG_NAME="${CUSTOM_TAG}" elif [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then @@ -1226,7 +1231,8 @@ jobs: ./build/bin/quantize models/ggml-tiny.en.bin models/ggml-tiny.en-q4_0.bin q4_0 release: - if: ${{ github.event.inputs.create_release == 'true' || github.event.inputs.pre_release_tag != '' }} + if: ${{ github.event.inputs.create_release == 'true' || github.event.inputs.pre_release_tag != '' || startsWith(github.ref, 'refs/tags/v') }} + runs-on: ubuntu-latest