Skip to content

Commit 6f36628

Browse files
committed
Do not include full path to binary in .sha512 files on darwin
See ipfs/kubo#9323. This is a darwin release thing because the signature process for macOS means that we recalculate sha512 and cid and we do this using an absolute path so the result includes the path to the file. The fix is to cd to the folder and do it from there.
1 parent 1499621 commit 6f36628

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

scripts/ci/sign-new-macos-releases.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,20 @@ echo "::group::Update changed binaries in ./releases"
121121
echo "-> Updating $PKG_NAME"
122122
rm "$PKG_PATH"
123123
tar -czvf "${WORK_DIR}/releases/${DIST_NAME}/${DIST_VERSION}/$PKG_NAME" -C "${WORK_DIR}/tmp/${DIST_NAME}_${DIST_VERSION}_${arch}-signed/" "${DIST_NAME}"
124+
pushd "${PKG_ROOT}"
124125
# calculate new hashes
125-
NEW_CID=$(ipfs add -Qn "$PKG_PATH")
126-
NEW_SHA512_LINE=$(gsha512sum "$PKG_PATH")
126+
NEW_CID=$(ipfs add -Qn "$PKG_NAME")
127+
NEW_SHA512_LINE=$(gsha512sum "$PKG_NAME")
127128
NEW_SHA512=$(echo "$NEW_SHA512_LINE" | gawk '{ print $1; }')
128129
echo "-> New $PKG_NAME"
129130
echo " new CID: $NEW_CID"
130131
echo " new SHA512: $NEW_SHA512"
131132
# update metadata to use new hashes
132-
echo "$NEW_CID" > "${PKG_PATH}.cid"
133-
echo "$NEW_SHA512_LINE" > "${PKG_PATH}.sha512"
134-
gsed -i "s/${OLD_CID}/${NEW_CID}/g; s/${OLD_SHA512}/${NEW_SHA512}/g" "${PKG_ROOT}/dist.json"
133+
echo "$NEW_CID" > "${PKG_NAME}.cid"
134+
echo "$NEW_SHA512_LINE" > "${PKG_NAME}.sha512"
135+
gsed -i "s/${OLD_CID}/${NEW_CID}/g; s/${OLD_SHA512}/${NEW_SHA512}/g" "dist.json"
135136
echo "-> Completed the update of ${arch}.tar.gz for ${DIST_NAME} ${DIST_VERSION}"
137+
popd
136138
done
137139
done
138140
echo "::endgroup::"

0 commit comments

Comments
 (0)