Skip to content

Commit

Permalink
fix macos release
Browse files Browse the repository at this point in the history
  • Loading branch information
Yong He authored and Yong He committed Jul 13, 2024
1 parent 308e7fe commit cf29c03
Showing 1 changed file with 16 additions and 22 deletions.
38 changes: 16 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,7 @@ jobs:
if [[ -f "$b" ]]; then
echo "Signing binary '$b'..."
/usr/bin/codesign --force --options runtime -s "${IDENTITY_ID}" "$b" -v
echo "checksum(0) '$b':"
shasum -a 256 "$b"
7z a "slang-macos-dist.zip" "$b"
echo "checksum(1) '$b':"
shasum -a 256 "$b"
fi
done
Expand All @@ -161,24 +157,22 @@ jobs:
mv "$(pwd)/build/dist-${config}/slang.tar.gz" "${base}.tar.gz"
echo "SLANG_BINARY_ARCHIVE_TAR=${base}.tar.gz" >> "$GITHUB_OUTPUT"
mkdir ./ttmp
unzip "${base}.zip" -d ./ttmp
echo "packed checksum slangd:"
shasum -a 256 "./ttmp/bin/slangd"
echo "checksum slangd after pack:"
shasum -a 256 "build/Release/bin/slangd"
/bin/cp -rf build/Release/bin/* ./ttmp/bin/
/bin/cp -rf build/Release/lib/* ./ttmp/lib/
echo "checksum slangd (overwrite):"
shasum -a 256 "./ttmp/bin/slangd"
rm ${base}.zip
rm ${base}.tar.gz
cd ./ttmp
7z a ../${base}.zip .
tar -czvf ../${base}.tar.gz .
cd ../
# For some reason, the binaries packed by cpack for macos is modified
# by cpack and considered damanged by macos. For now we workaround this
# by repacking all the binaries into the release package.
if [[ "${{ matrix.os }}" == "macos" ]]; then
mkdir ./ttmp
unzip "${base}.zip" -d ./ttmp
/bin/cp -rf build/Release/bin/* ./ttmp/bin/
/bin/cp -rf build/Release/lib/* ./ttmp/lib/
rm ${base}.zip
rm ${base}.tar.gz
cd ./ttmp
7z a ../${base}.zip .
tar -czvf ../${base}.tar.gz .
cd ../
fi
- name: File check
run: |
find "build/dist-$config" -print0 ! -iname '*.md' ! -iname '*.h' -type f | xargs -0 file
Expand Down

0 comments on commit cf29c03

Please sign in to comment.