Skip to content

Commit cf29c03

Browse files
Yong HeYong He
Yong He
authored and
Yong He
committed
fix macos release
1 parent 308e7fe commit cf29c03

File tree

1 file changed

+16
-22
lines changed

1 file changed

+16
-22
lines changed

.github/workflows/release.yml

+16-22
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,7 @@ jobs:
136136
if [[ -f "$b" ]]; then
137137
echo "Signing binary '$b'..."
138138
/usr/bin/codesign --force --options runtime -s "${IDENTITY_ID}" "$b" -v
139-
echo "checksum(0) '$b':"
140-
shasum -a 256 "$b"
141139
7z a "slang-macos-dist.zip" "$b"
142-
echo "checksum(1) '$b':"
143-
shasum -a 256 "$b"
144140
fi
145141
done
146142
@@ -161,24 +157,22 @@ jobs:
161157
mv "$(pwd)/build/dist-${config}/slang.tar.gz" "${base}.tar.gz"
162158
echo "SLANG_BINARY_ARCHIVE_TAR=${base}.tar.gz" >> "$GITHUB_OUTPUT"
163159
164-
mkdir ./ttmp
165-
unzip "${base}.zip" -d ./ttmp
166-
echo "packed checksum slangd:"
167-
shasum -a 256 "./ttmp/bin/slangd"
168-
169-
echo "checksum slangd after pack:"
170-
shasum -a 256 "build/Release/bin/slangd"
171-
172-
/bin/cp -rf build/Release/bin/* ./ttmp/bin/
173-
/bin/cp -rf build/Release/lib/* ./ttmp/lib/
174-
echo "checksum slangd (overwrite):"
175-
shasum -a 256 "./ttmp/bin/slangd"
176-
rm ${base}.zip
177-
rm ${base}.tar.gz
178-
cd ./ttmp
179-
7z a ../${base}.zip .
180-
tar -czvf ../${base}.tar.gz .
181-
cd ../
160+
# For some reason, the binaries packed by cpack for macos is modified
161+
# by cpack and considered damanged by macos. For now we workaround this
162+
# by repacking all the binaries into the release package.
163+
if [[ "${{ matrix.os }}" == "macos" ]]; then
164+
mkdir ./ttmp
165+
unzip "${base}.zip" -d ./ttmp
166+
167+
/bin/cp -rf build/Release/bin/* ./ttmp/bin/
168+
/bin/cp -rf build/Release/lib/* ./ttmp/lib/
169+
rm ${base}.zip
170+
rm ${base}.tar.gz
171+
cd ./ttmp
172+
7z a ../${base}.zip .
173+
tar -czvf ../${base}.tar.gz .
174+
cd ../
175+
fi
182176
- name: File check
183177
run: |
184178
find "build/dist-$config" -print0 ! -iname '*.md' ! -iname '*.h' -type f | xargs -0 file

0 commit comments

Comments
 (0)