Generate checksums for nightly binaries (#7149)

This commit is contained in:
Armel Soro
2023-11-20 09:23:57 +01:00
committed by GitHub
parent 6234a1722a
commit ba0c9575f7
2 changed files with 83 additions and 25 deletions

View File

@@ -62,15 +62,29 @@ jobs:
export GITCOMMIT="$(git describe --no-match --always --abbrev=9 --dirty --broken)-nightly"
make cross
- name: Upload binaries
- name: Rename binaries with OS and Arch
run: |
baseUrl="https://s3.${IBM_CLOUD_REGION}.cloud-object-storage.appdomain.cloud/${IBM_CLOUD_OBJECT_STORAGE_BUCKET}"
for f in `find ./dist/bin -type f -name 'odo*'`; do
for f in `find ./dist/bin -type f -name 'odo*'`; do
bin=$(realpath "$f")
targetName=$(basename "$f" .exe)-$(basename $(dirname "$f"))
if [[ "${targetName}" == "odo-windows-"* ]]; then
targetName="${targetName}.exe"
fi
ibmcloud cos upload --bucket "${IBM_CLOUD_OBJECT_STORAGE_BUCKET}" --key "${targetName}" --file "${bin}"
echo "Binary $bin uploaded successfully and available at: ${baseUrl}/${targetName}"
mv "${bin}" $(dirname "$f")/${targetName}
done
- name: Generate SHA-256 checksums
run: |
for f in `find ./dist/bin -type f -name 'odo*'`; do
bin=$(realpath "$f")
sha256sum -b "${bin}" | awk '{print $1}' > "${bin}".sha256
done
- name: Upload binaries
run: |
baseUrl="https://s3.${IBM_CLOUD_REGION}.cloud-object-storage.appdomain.cloud/${IBM_CLOUD_OBJECT_STORAGE_BUCKET}"
for f in `find ./dist/bin -type f -name 'odo*'`; do
bin=$(realpath "$f")
ibmcloud cos upload --bucket "${IBM_CLOUD_OBJECT_STORAGE_BUCKET}" --key $(basename "$f") --file "${bin}"
echo "Binary $bin uploaded successfully and available at: ${baseUrl}/$(basename "$f")"
done