ci: fix macOS package creation

This commit is contained in:
Anton Kochkov 2026-02-01 14:15:50 +04:00 committed by NOT XVilka
parent 6cacb99e98
commit 20769eaaa7
9 changed files with 25 additions and 23 deletions

View file

@ -630,10 +630,10 @@ jobs:
./rizin_cmake_test
working-directory: rizin
build-osx-pkg:
name: Build OSX package
build-macos-pkg:
name: Build macOS package
runs-on: macos-15
if: contains(github.head_ref, 'dist') || contains(github.head_ref, 'osx') || contains(github.head_ref, 'mac') || ((contains(github.ref, 'release-') || github.ref == 'refs/heads/stable') && github.event_name == 'push') || github.event_name == 'schedule'
if: contains(github.head_ref, 'dist') || contains(github.head_ref, 'macos') || contains(github.head_ref, 'mac') || ((contains(github.ref, 'release-') || github.ref == 'refs/heads/stable') && github.event_name == 'push') || github.event_name == 'schedule'
needs: [ build-and-test ]
steps:
- uses: actions/checkout@v6
@ -641,11 +641,13 @@ jobs:
fetch-depth: 2
- name: Install meson and ninja
run: pip3 install meson ninja PyYAML
env:
PIP_BREAK_SYSTEM_PACKAGES: 1
- name: Install ImageMagick
run: brew install imagemagick
- name: Create OSX package
- name: Create macOS package
run: |
./dist/osx/build_osx_package.sh
./dist/macos/build_macos_package.sh
mv rizin-*.pkg rizin.pkg
- name: Upload .pkg file
uses: actions/upload-artifact@v6
@ -853,14 +855,14 @@ jobs:
echo "import rizin" > testimport.py
python3 testimport.py
test-osx-pkg:
name: Test OSX pkg
test-macos-pkg:
name: Test macOS pkg
strategy:
matrix:
system:
- macos-15
runs-on: ${{ matrix.system }}
needs: [ build-osx-pkg ]
needs: [ build-macos-pkg ]
steps:
- uses: actions/download-artifact@v7
with:
@ -946,7 +948,7 @@ jobs:
build-static,
build-android,
build-cpp-linux,
test-osx-pkg,
test-macos-pkg,
test-windows-clang_cl,
build-rzpipe,
]

View file

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View file

@ -1,11 +1,11 @@
#!/bin/sh -eu
#
# Script to create a OSX .pkg file to install Rizin
# Script to create a macOS .pkg file to install Rizin
VERSION=$(python3 ./sys/version.py)
RIZINDIR=$(pwd)
RIZININSTALL=/tmp/rizin-install
OSXPKGDIR=/tmp/osxpkgtmp
MACOSPKGDIR=/tmp/macospkgtmp
rm -rf buildtmp
mkdir buildtmp
@ -14,20 +14,20 @@ rm -rf "${RIZININSTALL}"
DESTDIR="${RIZININSTALL}" ninja -C buildtmp install
rm -rf buildtmp
rm -rf "${OSXPKGDIR}"
mkdir "${OSXPKGDIR}"
cp -rv "${RIZINDIR}/dist/osx/rizin.unpkg/" "${OSXPKGDIR}/"
rm -rf "${MACOSPKGDIR}"
mkdir "${MACOSPKGDIR}"
cp -rv "${RIZINDIR}/dist/macos/rizin.unpkg/" "${MACOSPKGDIR}/"
cd "${RIZININSTALL}" && find . | cpio -o --format odc | gzip -c > "${OSXPKGDIR}/Payload"
mkbom "${RIZININSTALL}" "${OSXPKGDIR}/Bom"
pkgutil --flatten "${OSXPKGDIR}" "${RIZINDIR}/dist/osx/rizin.pkg"
cd "${RIZININSTALL}" && find . | cpio -o --format odc | gzip -c > "${MACOSPKGDIR}/Payload"
mkbom "${RIZININSTALL}" "${MACOSPKGDIR}/Bom"
pkgutil --flatten "${MACOSPKGDIR}" "${RIZINDIR}/dist/macos/rizin.pkg"
convert -size 620x418 xc:none -background none /tmp/bg.png || { echo convert failed, is imagemagick installed?; exit 1; }
composite -geometry +30+230 -background none \( "${RIZINDIR}/doc/img/rizin.svg" -resize 25% \) /tmp/bg.png -colorspace sRGB "${RIZINDIR}/dist/osx/Resources/rizin-logo.png"
composite -geometry +30+230 -background none \( "${RIZINDIR}/doc/img/rizin.svg" -resize 25% \) /tmp/bg.png -colorspace sRGB "${RIZINDIR}/dist/macos/Resources/rizin-logo.png"
cd "${RIZINDIR}/dist/osx" && productbuild --resources Resources --distribution Distribution "rizin-${VERSION}.pkg"
mv "${RIZINDIR}/dist/osx/rizin-${VERSION}.pkg" "${RIZINDIR}/rizin-${VERSION}.pkg"
cd "${RIZINDIR}/dist/macos" && productbuild --resources Resources --distribution Distribution "rizin-${VERSION}.pkg"
mv "${RIZINDIR}/dist/macos/rizin-${VERSION}.pkg" "${RIZINDIR}/rizin-${VERSION}.pkg"
rm "${RIZINDIR}/dist/osx/rizin.pkg"
rm -rf "${OSXPKGDIR}"
rm "${RIZINDIR}/dist/macos/rizin.pkg"
rm -rf "${MACOSPKGDIR}"
rm -rf "${RIZININSTALL}"

View file

@ -152,7 +152,7 @@ esil man page).
Existing packages
-----------------
OSX: execute `dist/osx/build_osx_package.sh` on a MacOS system to create a .pkg installer in the base directory, named `rizin-${VERSION}.pkg`.
macOS: execute `dist/macos/build_macos_package.sh` on a MacOS system to create a .pkg installer in the base directory, named `rizin-${VERSION}.pkg`.
Windows installer: execute `dist/windows/build_windows_installer.ps1` Powershell script on a Windows system to create a .exe installer in `dist/windows/Output`, named `rizin.exe`.