Skip to content

Commit

Permalink
esp/ci: Separate checksum files for toolchain and standalone libs dis…
Browse files Browse the repository at this point in the history
…tros
  • Loading branch information
gerekon committed May 15, 2024
1 parent d7da292 commit 55758c3
Showing 1 changed file with 29 additions and 18 deletions.
47 changes: 29 additions & 18 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ before_script:
echo "DISTRO_PACK_PATH=${DISTRO_PACK_PATH}"
mv ${DISTRO_PACK_PATH} ${PWD}/${DIST_DIR}/
ARCHIVE_NAME=$(basename ${DISTRO_PACK_PATH})
echo "${ARCHIVE_NAME}" > ${PWD}/${DIST_DIR}/dist_name_libs_${CONF_HOST}
echo "${ARCHIVE_NAME}" > ${PWD}/${DIST_DIR}/libs_dist_name_${CONF_HOST}
fi
# pack target libraries to be re-used in distros for other platforms
- >
Expand Down Expand Up @@ -408,6 +408,17 @@ upload_to_http:
# Show info
- echo -e "\nArchives were published there:\n\n$(for n in ${FILES}; do echo "${HTTP_PUBLIC_DIR}/ct-ng/llvm-builds/${n}"; done)\n"

.gen_checksum_file: &gen_checksum_file |
ls -l ${FILES}
for n in ${FILES}; do
sz=$(stat -c%s "${n}") >> ${SHA256_FILE};
printf "# %s: %s bytes\n" "${n}" "${sz}" >> ${SHA256_FILE};
sha256sum -b "${n}" >> ${SHA256_FILE};
done
# Append FILES with checksum file
FILES=$(echo -e "${FILES}\n${SHA256_FILE}")
ls -l ${FILES}

upload_to_github:
stage: public_deploy
when: manual
Expand All @@ -421,7 +432,8 @@ upload_to_github:
GITHUB_TOKEN: "${GH_TOKEN}"
GITHUB_REPO: "${GH_REPO_HTTPS}"
TAG: "${CI_COMMIT_TAG}"
SHA256_FILE: esp-clang-${CI_COMMIT_TAG}-checksum.sha256
TOOLCHAIN_SHA256_FILE: clang-${CI_COMMIT_TAG}-checksum.sha256
LIBS_SHA256_FILE: libs-clang-${CI_COMMIT_TAG}-checksum.sha256
needs:
- job: pack_x86_64-linux-gnu
- job: pack_arm-linux-gnueabihf
Expand All @@ -431,25 +443,24 @@ upload_to_github:
- job: sign_aarch64-apple-darwin
before_script: []
script:
- ls -l dist*/
- ls -l ${DIST_DIR}
- cd ${DIST_DIR}
- git remote add github ${GH_REPO_HTTPS}
- hub release show ${TAG} || { echo "Please create a release on GitHub with ${TAG} tag at first"; exit 1; }
# Generate checksum file for toolchain
# List of archives
- FILES=$(find ${DIST_DIR} -name dist_name_\* -exec cat {} \+)
- cd ${DIST_DIR}
- ls -l $FILES
# Generate checksum file
- >
for n in $FILES; do
sz=$(stat -c%s "${n}") >> ${SHA256_FILE};
printf "# %s: %s bytes\n" "${n}" "${sz}" >> ${SHA256_FILE};
sha256sum -b "${n}" >> ${SHA256_FILE};
done
# Append FILES with checksum file
- FILES=$(echo -e "${FILES}\n${SHA256_FILE}")
- ls -l $FILES
- FILES=$(find ${PWD} -name dist_name_\* -exec cat {} \+)
- SHA256_FILE=${TOOLCHAIN_SHA256_FILE}
- *gen_checksum_file
- DIST_FILES=${FILES}
# Generate checksum file for standalone libraries
- FILES=$(find ${PWD} -name libs_dist_name_\* -exec cat {} \+)
- SHA256_FILE=${LIBS_SHA256_FILE}
- *gen_checksum_file
- DIST_FILES=$(echo -e "${DIST_FILES}\n${FILES}")
- ls -l ${DIST_FILES}
# Upload archives
- for n in ${FILES}; do hub release edit -m "" -a "${n}" "${TAG}"; done
- for n in ${DIST_FILES}; do hub release edit -m "" -a "${n}" "${TAG}"; done

update_idf_tools:
stage: update_idf_tools
Expand All @@ -461,7 +472,7 @@ update_idf_tools:
TOOL_NAME: esp-clang
TOOL_MEMBERS: esp-clang
TOOL_VERSION: ${CI_COMMIT_TAG}
TOOL_SHA256_URL: https://github.com/espressif/openocd-esp32/releases/download/esp-clang-${CI_COMMIT_TAG}/esp-clang-${CI_COMMIT_TAG}-checksum.sha256
TOOL_SHA256_URL: https://github.com/espressif/llvm-project/releases/download/${CI_COMMIT_TAG}/clang-${CI_COMMIT_TAG}-checksum.sha256
RN_SECTION: Toolchain
trigger:
project: idf/idf-tools-updater
Expand Down

0 comments on commit 55758c3

Please sign in to comment.