From cd9d8771c2b743de97d672edbbf5587acbcbaba3 Mon Sep 17 00:00:00 2001 From: jianlins Date: Thu, 12 Mar 2026 23:02:38 -0600 Subject: [PATCH] workflow: update source checkout step and add tag creation logic in build script --- .github/workflows/custom_build_rockylinux.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/custom_build_rockylinux.yml b/.github/workflows/custom_build_rockylinux.yml index 3b45c5b444..6a53f84dc0 100644 --- a/.github/workflows/custom_build_rockylinux.yml +++ b/.github/workflows/custom_build_rockylinux.yml @@ -56,13 +56,26 @@ jobs: which dnf clean all - - name: Checkout source at release tag + - name: Checkout source uses: actions/checkout@v4 with: - ref: ${{ env.TAG_NAME }} submodules: recursive fetch-depth: 0 + - name: Create tag if it does not exist + shell: bash + run: | + set -euxo pipefail + git config --global --add safe.directory "${GITHUB_WORKSPACE:-/__w/llama.cpp/llama.cpp}" + if git rev-parse "refs/tags/${TAG_NAME}" >/dev/null 2>&1; then + echo "Tag ${TAG_NAME} already exists, checking out." + git checkout "${TAG_NAME}" + else + echo "Tag ${TAG_NAME} does not exist, creating it on HEAD." + git tag "${TAG_NAME}" + git push origin "refs/tags/${TAG_NAME}" + fi + - name: Show build environment shell: bash run: | @@ -140,4 +153,4 @@ jobs: tag_name: ${{ env.TAG_NAME }} files: | ./${{ env.ARCHIVE_BASENAME }}-${{ env.TAG_NAME }}.tar.gz - ./${{ env.ARCHIVE_BASENAME }}-${{ env.TAG_NAME }}.tar.gz.sha256 + ./${{ env.ARCHIVE_BASENAME }}-${{ env.TAG_NAME }}.tar.gz.sha256 \ No newline at end of file