From 4f4148e2f68689eb8861bf9fce0b46ada9200fef Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Fri, 15 Aug 2025 12:12:14 +0200 Subject: [PATCH] ci: fix paths in the checksum file --- .github/workflows/build.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 26f9bb4086..6697fa3d35 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -175,7 +175,7 @@ jobs: dist/ Upload: - # if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') needs: [ Vars, Build ] runs-on: ubuntu-latest steps : @@ -220,10 +220,16 @@ jobs: ls -l DIST_FILE_LIST=$(find . -name file_\* -exec cat {} \+) DIST_FILE_LIST="${DIST_FILE_LIST} ${RELEASE_SRC_FILE}" + RELEASE_CHECKSUM_FILE=$(realpath "${RELEASE_CHECKSUM_FILE}") for n in $DIST_FILE_LIST; do - sz=$(stat -c%s "${n}") - printf "# %s: %s bytes\n" "${n}" "${sz}" >> "${RELEASE_CHECKSUM_FILE}" - sha256sum -b "${n}" >> "${RELEASE_CHECKSUM_FILE}" + # Release archives might be in subdirectories, but we need just the file names in the checksum file + n_dir=$(dirname "${n}") + n_file=$(basename "${n}") + pushd "${n_dir}" > /dev/null + sz=$(stat -c%s "${n_file}") + printf "# %s: %s bytes\n" "${n_file}" "${sz}" >> "${RELEASE_CHECKSUM_FILE}" + sha256sum -b "${n_file}" >> "${RELEASE_CHECKSUM_FILE}" + popd > /dev/null done DIST_FILE_LIST="${DIST_FILE_LIST} ${RELEASE_CHECKSUM_FILE}" # remove new lines from file list