Skip to content

Commit

Permalink
Merge pull request #8 from gmbeard/fix/static-dist
Browse files Browse the repository at this point in the history
fix(tooling) Ensures static binary is stripped and hashed
  • Loading branch information
gmbeard authored Jul 29, 2023
2 parents 76e5bb6 + 8e55f48 commit 0524d47
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions .versioning/changes/wfIMgIBmTW.patch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixes static binary dist util; Strips and SHA256 hashes
10 changes: 9 additions & 1 deletion tools/make-dist
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,15 @@ tar \
cd ./dist
sha256sum ${projectname}-source-${version}.tar.xz >${projectname}-source-${version}.sha256

[[ -d "${topdir}/build" ]] || mkdir "${topdir}/build"

cmake -S "${topdir}" -B "${topdir}/build" --fresh -DCMAKE_BUILD_TYPE=Release -DSEMVERUTIL_STATIC_BINARY=ON
cmake --build "${topdir}/build" --clean-first

staticbin=$(find "${topdir}" -type f -executable -name ${projectname}-static | head -1)
if [[ -n "${staticbin}" ]]; then
cp "${staticbin}" "${topdir}/dist/${projectname}-static-$(uname -s)-$(uname -m)"
outname="${projectname}-static-$(uname -s)-$(uname -m)"
cp "${staticbin}" "${topdir}/dist/${outname}"
strip --strip-unneeded "${topdir}/dist/${outname}"
sha256sum "${outname}" >"${outname}.sha256"
fi

0 comments on commit 0524d47

Please sign in to comment.