workflow: update source checkout step and add tag creation logic in build script

This commit is contained in:
jianlins 2026-03-12 23:02:38 -06:00
parent 25581cbb35
commit cd9d8771c2
1 changed files with 16 additions and 3 deletions

View File

@ -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