Skip to content

Commit

Permalink
Append ARCH in the macOS package name
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Aug 16, 2022
1 parent 301d3b3 commit c41acd9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/artifacts/build-macos/r2frida-${{ steps.r2fv.outputs.branch }}-macos.pkg
asset_name: r2frida-${{ steps.r2fv.outputs.branch }}-macos.pkg
asset_path: dist/artifacts/build-macos/r2frida-${{ steps.r2fv.outputs.branch }}-x64.pkg
asset_name: r2frida-${{ steps.r2fv.outputs.branch }}-x64.pkg
asset_content_type: application/octet-stream
- name: Upload asset for Windows (w64)
uses: actions/upload-release-asset@v1
Expand Down
14 changes: 12 additions & 2 deletions dist/macos/make-macos-pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@

SRC=/tmp/r2frida-macos
PREFIX=/usr/local
ARM64CHK=`echo "$CFLAGS $ARCHFLAGS" | grep arm64`
if [ -n "$ARM64CHK" ]; then
# crossbuild arm64 build
ARCH=m1
elif [ "`uname -m`" = arm64 ]; then
# local arm64 build
ARCH=m1
else
ARCH=x64
fi
DST="$(pwd)/macos-pkg/r2frida.unpkg"
if [ -n "$1" ]; then
VERSION="$1"
Expand Down Expand Up @@ -43,10 +53,10 @@ if [ -d "${SRC}" ]; then
)
mkbom ${SRC} "${DST}/Bom"
# Repackage
pkgutil --flatten "${DST}" "${DST}/../r2frida-${VERSION}.pkg"
pkgutil --flatten "${DST}" "${DST}/../r2frida-${VERSION}-${ARCH}.pkg"
mv dist/macos/macos-pkg/*.pkg dist/macos
cp -f dist/macos/*.pkg .
else
echo "Failed install. DESTDIR is empty"
echo "Failed install. DESTDIR is empty" > /dev/stderr
exit 1
fi

0 comments on commit c41acd9

Please sign in to comment.