From 5a246b451524ce5fdbea5f30850d300bfdcf97de Mon Sep 17 00:00:00 2001 From: Green Sky Date: Sat, 1 Nov 2025 18:47:48 +0100 Subject: [PATCH] update checkout action and change release name to include git log depth for better sorting in the release page --- .github/workflows/cd.yml | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 410722d32..fc4bd9e92 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: submodules: recursive fetch-depth: 0 @@ -37,8 +37,9 @@ jobs: # taken from llama.cpp run: | SHORT_HASH="$(git rev-parse --short=7 HEAD)" + DEPTH="$(git rev-list --count HEAD)" if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then - echo "name=dev-${SHORT_HASH}" >> $GITHUB_OUTPUT + echo "name=dev-${DEPTH}-${SHORT_HASH}" >> $GITHUB_OUTPUT else SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-') echo "name=dev-${SAFE_NAME}-${SHORT_HASH}" >> $GITHUB_OUTPUT @@ -78,12 +79,12 @@ jobs: ndk_abi: x86_64 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: submodules: recursive fetch-depth: 0 - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: repository: 'Green-Sky/vcpkg_android_triplets' path: 'vcpkg_android_triplets' @@ -144,8 +145,9 @@ jobs: # taken from llama.cpp run: | SHORT_HASH="$(git rev-parse --short=7 HEAD)" + DEPTH="$(git rev-list --count HEAD)" if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then - echo "name=dev-${SHORT_HASH}" >> $GITHUB_OUTPUT + echo "name=dev-${DEPTH}-${SHORT_HASH}" >> $GITHUB_OUTPUT else SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-') echo "name=dev-${SAFE_NAME}-${SHORT_HASH}" >> $GITHUB_OUTPUT @@ -178,7 +180,7 @@ jobs: contents: read steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: submodules: recursive fetch-depth: 0 @@ -226,8 +228,9 @@ jobs: # taken from llama.cpp run: | SHORT_HASH="$(git rev-parse --short=7 HEAD)" + DEPTH="$(git rev-list --count HEAD)" if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then - echo "name=dev-${SHORT_HASH}" >> $GITHUB_OUTPUT + echo "name=dev-${DEPTH}-${SHORT_HASH}" >> $GITHUB_OUTPUT else SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-') echo "name=dev-${SAFE_NAME}-${SHORT_HASH}" >> $GITHUB_OUTPUT @@ -275,9 +278,10 @@ jobs: contents: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: submodules: recursive + fetch-depth: 0 - name: Determine tag name id: tag @@ -285,8 +289,9 @@ jobs: # taken from llama.cpp run: | SHORT_HASH="$(git rev-parse --short=7 HEAD)" + DEPTH="$(git rev-list --count HEAD)" if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then - echo "name=dev-${SHORT_HASH}" >> $GITHUB_OUTPUT + echo "name=dev-${DEPTH}-${SHORT_HASH}" >> $GITHUB_OUTPUT else SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-') echo "name=dev-${SAFE_NAME}-${SHORT_HASH}" >> $GITHUB_OUTPUT @@ -347,9 +352,10 @@ jobs: contents: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: submodules: recursive + fetch-depth: 0 - name: Determine tag name id: tag @@ -357,8 +363,9 @@ jobs: # taken from llama.cpp run: | SHORT_HASH="$(git rev-parse --short=7 HEAD)" + DEPTH="$(git rev-list --count HEAD)" if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then - echo "name=dev-${SHORT_HASH}" >> $GITHUB_OUTPUT + echo "name=dev-${DEPTH}-${SHORT_HASH}" >> $GITHUB_OUTPUT else SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-') echo "name=dev-${SAFE_NAME}-${SHORT_HASH}" >> $GITHUB_OUTPUT