Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mac: CI/bundle update #7166

Merged
merged 12 commits into from
Aug 12, 2024
86 changes: 61 additions & 25 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,25 @@ jobs:
build:
runs-on: macos-12
steps:
- uses: actions/checkout@v4
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-tags: '0'
fetch-depth: '0'
- name: Install dependencies
run: |
date -u
mkdir build
date +%s > build/stamp
brew uninstall --ignore-dependencies libtiff
brew install libtiff gtk+3 gtkmm3 gtk-mac-integration adwaita-icon-theme libsigc++@2 little-cms2 libiptcdata fftw lensfun expat pkgconfig llvm shared-mime-info exiv2 jpeg-xl libomp automake libtool | tee -a depslog
brew install imagemagick create-dmg libtiff gtk+3 gtkmm3 gtk-mac-integration adwaita-icon-theme libsigc++@2 little-cms2 libiptcdata fftw lensfun expat pkgconfig llvm shared-mime-info exiv2 jpeg-xl libomp automake libtool | tee -a depslog
date -u
echo "----====Pourage====----"
cat depslog | grep Pouring
zsh -c 'echo "Completed installation of dependencies in $(printf "%0.2f" $(($[$(date +%s)-$(cat build/stamp)]/$((60.))))) minutes"'
zsh -c 'echo "Completed installation of dependencies in $(printf "%0.2f" $(($[$(date +%s)-$(cat build/stamp)]/$((60.))))) minutes"' >> $GITHUB_STEP_SUMMARY
- name: Configure build system
env:
IDENT: '-'
CMAKE_CXX_STANDARD: 11
PKG_CONFIG_PATH: /usr/local/opt/libtiff/lib/pkgconfig:/usr/local/opt/libffi/lib/pkgconfig:/usr/local/opt/expat/lib/pkgconfig
C_FLAGS: >
Expand All @@ -47,12 +52,12 @@ jobs:
cmake \
-DCMAKE_BUILD_TYPE="Release" \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_EXE_LINKER_FLAGS="-L. -L/usr/local/lib -Wl,-rpath -Wl,/usr/local/lib -L/usr/local/opt/gdk-pixbuf/lib -L/usr/local/opt/libiconv/lib -L/usr/local/opt/libomp/lib -L/usr/local/opt/libffi/lib -L/usr/local/opt/libffi/lib -L/usr/local/opt/libxml2/lib -L/usr/local/opt/expat/lib" \
-DCMAKE_EXE_LINKER_FLAGS="-L. -L/usr/local/lib -Wl,-rpath -Wl,/usr/local/lib -L/usr/local/opt/gdk-pixbuf/lib -L/usr/local/opt/libomp/lib -L/usr/local/opt/expat/lib" \
-DCACHE_NAME_SUFFIX="${RAW_THERAPEE_VERSION}-${REF}" \
-DPROC_TARGET_NUMBER="1" \
-DPROC_LABEL="generic processor" \
-DCMAKE_OSX_ARCHITECTURES=$(uname -m) \
-DWITH_LTO="OFF" \
-DWITH_LTO="ON" \
-DLENSFUNDBDIR="/Applications/RawTherapee.app/Contents/Resources/share/lensfun" \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
Expand All @@ -67,28 +72,30 @@ jobs:
-DCMAKE_RANLIB=/usr/bin/ranlib \
-DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 \
-DCONTINUOUS=ON \
-DCODESIGNID:STRING="-" \
-DCODESIGNID:STRING="$IDENT" \
-DFANCY_DMG="ON" \
..
zsh -c 'echo "Configured in $(printf "%0.2f" $(($[$(date +%s)-$(cat configstamp)]/$((60.))))) minutes"'
zsh -c 'echo "Configured in $(printf "%0.2f" $(($[$(date +%s)-$(cat configstamp)]/$((60.))))) minutes"' >> $GITHUB_STEP_SUMMARY
- name: Compile RawTherapee
run: |
date -u && date +%s > build/compilestamp
cd build
export REF=${GITHUB_REF##*/}
make -j$(sysctl -a | grep machdep.cpu.thread_count | tail -c 2) install
zsh -c 'echo "Compiled in $(printf "%0.2f" $(($[$(date +%s)-$(cat compilestamp)]/$((60.))))) minutes"'
zsh -c 'echo "Compiled in $(printf "%0.2f" $(($[$(date +%s)-$(cat compilestamp)]/$((60.))))) minutes"' >> $GITHUB_STEP_SUMMARY
- name: Create application bundle
run: |
zsh
date +%s > build/bundlestamp && date -u && cd build
export REF=${GITHUB_REF##*/} && export LOCAL_PREFIX=/usr && sudo make macosx_bundle
echo "Automated Build! WARNING:\nNot intended for end-user testing." > message
export REF=${GITHUB_REF##*/} && sudo make macosx_bundle
export ARTIFACT=(RawTherapee*${CMAKE_BUILD_TYPE}.zip)
echo "=== artifact: ${ARTIFACT}"
# defining environment variables for next step as per
# https://github.com/actions/starter-workflows/issues/68
echo "ARTIFACT_PATH=${GITHUB_WORKSPACE}/build/${ARTIFACT}" >> $GITHUB_ENV
echo "ARTIFACT_FILE=${ARTIFACT}" >> $GITHUB_ENV
zsh -c 'echo "Bundled in $(printf "%0.2f" $(($[$(date +%s)-$(cat bundlestamp)]/$((60.))))) minutes"'
zsh -c 'echo "Bundled in $(printf "%0.2f" $(($[$(date +%s)-$(cat bundlestamp)]/$((60.))))) minutes"' >> $GITHUB_STEP_SUMMARY
printf '%s\n' \
"REF: ${REF}" \
"ARTIFACT: ${ARTIFACT}" \
Expand All @@ -103,40 +110,54 @@ jobs:
- name: Finish build
run: |
date -u
zsh -c 'echo "Build completed in $(printf "%0.2f" $(($[$(date +%s)-$(cat build/stamp)]/$((60.))))) minutes"'
zsh -c 'echo "Build completed in $(printf "%0.2f" $(($[$(date +%s)-$(cat build/stamp)]/$((60.))))) minutes"' >> $GITHUB_STEP_SUMMARY

- name: Test-launch the app
run: |
cd build
sudo cp -R RawTherapee.app /Applications
open -a RawTherapee
open -a /Applications/RawTherapee.app
sleep 5
osascript -e 'tell application "Finder"' -e 'get the name of every process whose visible is true' -e 'end tell'
echo "Applications running: $(osascript -e 'tell application "Finder" to get the name of every process whose visible is true')" >> $GITHUB_STEP_SUMMARY
osascript -e 'if application "RawTherapee" is not running then do shell script "exit 1"'
osascript -e 'tell application "RawTherapee" to if it is running then quit'

- name: Test the -cli
run: |
cd build
echo "$(RawTherapee*folder/rawtherapee-cli --version)" >> $GITHUB_STEP_SUMMARY

- name: Publish artifacts
uses: softprops/action-gh-release@v2
if: ${{github.ref_type == 'tag' || github.ref_name == 'dev'}}
with:
tag_name: nightly-github-actions
files: |
${{env.ARTIFACT_PATH}}


armbuild:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-tags: '0'
fetch-depth: '0'
- name: Install dependencies
run: |
date -u
mkdir build
date +%s > build/stamp
brew uninstall --ignore-dependencies libtiff
brew install libtiff gtk+3 gtkmm3 gtk-mac-integration adwaita-icon-theme libsigc++@2 little-cms2 libiptcdata fftw lensfun expat pkgconfig llvm shared-mime-info exiv2 jpeg-xl libomp automake libtool | tee -a depslog
brew install imagemagick create-dmg libtiff gtk+3 gtkmm3 gtk-mac-integration adwaita-icon-theme libsigc++@2 little-cms2 libiptcdata fftw lensfun expat pkgconfig llvm shared-mime-info exiv2 jpeg-xl libomp automake libtool | tee -a depslog
date -u
echo "----====Pourage====----"
cat depslog | grep Pouring
zsh -c 'echo "Completed installation of dependencies in $(printf "%0.2f" $(($[$(date +%s)-$(cat build/stamp)]/$((60.))))) minutes"'
zsh -c 'echo "Completed installation of dependencies in $(printf "%0.2f" $(($[$(date +%s)-$(cat build/stamp)]/$((60.))))) minutes"' >> $GITHUB_STEP_SUMMARY
- name: Configure build system
env:
IDENT: '-'
CMAKE_CXX_STANDARD: 11
PKG_CONFIG_PATH: /opt/homebrew/opt/libtiff/lib/pkgconfig:opt/homebrew/opt/libffi/lib/pkgconfig:/ope/homebrew/opt/expat/lib/pkgconfig
C_FLAGS: >
Expand All @@ -152,7 +173,7 @@ jobs:
cmake \
-DCMAKE_BUILD_TYPE="Release" \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_EXE_LINKER_FLAGS="-L. -L/opt/homebrew/lib -Wl,-rpath -Wl,/opt/homebrew/lib -L/opt/homebrew/opt/gdk-pixbuf/lib -L/opt/homebrew/opt/libiconv/lib -L/opt/homebrew/opt/libomp/lib -L/opt/homebrew/opt/libffi/lib -L/opt/homebrew/opt/libffi/lib -L/opt/homebrew/opt/libxml2/lib -L/opt/homebrew/opt/expat/lib" \
-DCMAKE_EXE_LINKER_FLAGS="-L. -L/opt/homebrew/lib -Wl,-rpath -Wl,/opt/homebrew/lib -L/opt/homebrew/opt/gdk-pixbuf/lib -L/opt/homebrew/opt/libomp/lib -L/opt/homebrew/opt/expat/lib" \
-DCACHE_NAME_SUFFIX="${RAW_THERAPEE_VERSION}-${REF}" \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
-DWITH_LTO="ON" \
Expand All @@ -170,48 +191,63 @@ jobs:
-DCMAKE_RANLIB=/usr/bin/ranlib \
-DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 \
-DCONTINUOUS=ON \
-DCODESIGNID:STRING="-" \
-DCODESIGNID:STRING="$IDENT" \
-DLOCAL_PREFIX=/opt/homebrew \
-DFANCY_DMG="ON" \
..
zsh -c 'echo "Configured in $(printf "%0.2f" $(($[$(date +%s)-$(cat configstamp)]/$((60.))))) minutes"'
zsh -c 'echo "Configured in $(printf "%0.2f" $(($[$(date +%s)-$(cat configstamp)]/$((60.))))) minutes"' >> $GITHUB_STEP_SUMMARY
- name: Compile RawTherapee
run: |
date -u && date +%s > build/compilestamp
cd build
export REF=${GITHUB_REF##*/}
make -j$(sysctl -a | grep machdep.cpu.thread_count | tail -c 2) install
zsh -c 'echo "Compiled in $(printf "%0.2f" $(($[$(date +%s)-$(cat compilestamp)]/$((60.))))) minutes"'
zsh -c 'echo "Compiled in $(printf "%0.2f" $(($[$(date +%s)-$(cat compilestamp)]/$((60.))))) minutes"' >> $GITHUB_STEP_SUMMARY
- name: Create application bundle
run: |
zsh
date +%s > build/bundlestamp && date -u && cd build
export REF=${GITHUB_REF##*/} && export LOCAL_PREFIX=/usr && sudo make macosx_bundle
echo "Automated Build! WARNING:\nNot intended for end-user testing." > message
export REF=${GITHUB_REF##*/} && sudo make macosx_bundle
export ARTIFACT=(RawTherapee*${CMAKE_BUILD_TYPE}.zip)
echo "=== artifact: ${ARTIFACT}"
# defining environment variables for next step as per
# https://github.com/actions/starter-workflows/issues/68
echo "ARTIFACT_PATH=${GITHUB_WORKSPACE}/build/${ARTIFACT}" >> $GITHUB_ENV
echo "ARTIFACT_FILE=${ARTIFACT}" >> $GITHUB_ENV
zsh -c 'echo "Bundled in $(printf "%0.2f" $(($[$(date +%s)-$(cat bundlestamp)]/$((60.))))) minutes"'
zsh -c 'echo "Bundled in $(printf "%0.2f" $(($[$(date +%s)-$(cat bundlestamp)]/$((60.))))) minutes"' >> $GITHUB_STEP_SUMMARY
printf '%s\n' \
"REF: ${REF}" \
"ARTIFACT: ${ARTIFACT}" \
"ARTIFACT_PATH: ${ARTIFACT_PATH}" \
"ARTIFACT_FILE: ${ARTIFACT_FILE}" \
"PUBLISH_NAME: ${PUBLISH_NAME}"
exit

- uses: actions/upload-artifact@v4
with:
name: ${{env.ARTIFACT_FILE}}
path: ${{env.ARTIFACT_PATH}}
- name: Finish build
run: |
date -u
zsh -c 'echo "Build completed in $(printf "%0.2f" $(($[$(date +%s)-$(cat build/stamp)]/$((60.))))) minutes"'
zsh -c 'echo "Build completed in $(printf "%0.2f" $(($[$(date +%s)-$(cat build/stamp)]/$((60.))))) minutes"' >> $GITHUB_STEP_SUMMARY

- name: Test-launch the app
run: |
cd build
cd build
sudo cp -R RawTherapee.app /Applications
time RawTherapee_*/rawtherapee-cli
open -a /Applications/RawTherapee.app
sleep 5
echo "Applications running: $(osascript -e 'tell application "Finder" to get the name of every process whose visible is true')" >> $GITHUB_STEP_SUMMARY
osascript -e 'if application "RawTherapee" is not running then do shell script "exit 1"'
osascript -e 'tell application "RawTherapee" to if it is running then quit'

- name: Test the -cli
run: |
cd build
echo "$(RawTherapee*folder/rawtherapee-cli --version)" >> $GITHUB_STEP_SUMMARY

- name: Publish artifacts
uses: softprops/action-gh-release@v2
if: ${{github.ref_type == 'tag' || github.ref_name == 'dev'}}
Expand Down
22 changes: 12 additions & 10 deletions tools/osx/macosx_bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -394,14 +394,14 @@ if [[ -n $NOTARY ]]; then
ditto -c -k --sequesterRsrc --keepParent "${APP}" "${APP}.zip"
echo "Uploading..."
sudo xcrun notarytool submit "${APP}.zip" ${NOTARY} --wait
sudo xcrun stapler staple "${APP}"
fi

function CreateDmg {
local srcDir="$(mktemp -dt $$.XXXXXXXXXXXX)"

msg "Preparing disk image sources at ${srcDir}:"
cp -R "${APP}" "${srcDir}"
cp "${RESOURCES}"/LICENSE "${srcDir}"
ln -s /Applications "${srcDir}"

# Web bookmarks
Expand All @@ -427,21 +427,23 @@ function CreateDmg {
msg "Creating disk image:"
if [[ $FANCY_DMG == "ON" ]]; then
echo "Building Fancy .dmg"
MESSAGE="$(cat message)"
magick ${PROJECT_SOURCE_DATA_DIR}/rtdmg-bkgd.png -pointsize 80 -fill Black -draw "text 14,1307 '${PROJECT_FULL_VERSION}'" -fill Salmon -draw "text 10,1300 '${PROJECT_FULL_VERSION}'" ./rtdmg-bkgd.png
magick ./rtdmg-bkgd.png -pointsize 90 -fill Black -gravity center -font Menlo-Bold -draw "text 5,120 \"$MESSAGE\"" -fill Red -gravity center -font Menlo-Bold -draw "text 1,124 \"$MESSAGE\"" ./rtdmg-bkgd.png
create-dmg \
--background ${PROJECT_SOURCE_DATA_DIR}/rtdmg-bkgd.png \
--background ./rtdmg-bkgd.png \
--volname ${PROJECT_NAME}_${PROJECT_FULL_VERSION} \
--volicon ${PROJECT_SOURCE_DATA_DIR}/rtdmg.icns \
--window-pos 72 72 \
--window-size 1000 689 \
--window-size 1000 692 \
--text-size 16 \
--icon-size 80 \
--icon LICENSE 810 0 \
--icon RawTherapee.app 250 178 \
--icon Applications 700 178 \
--icon Website.webloc 300 423 \
--icon Forum.webloc 420 423 \
--icon Report\ Bug.webloc 540 423 \
--icon Documentation.webloc 680 423 \
--icon RawTherapee.app 250 238 \
--icon Applications 700 238 \
--icon Website.webloc 300 487 \
--icon Forum.webloc 420 487 \
--icon Report\ Bug.webloc 540 487 \
--icon Documentation.webloc 680 487 \
--no-internet-enable \
--eula ${PROJECT_SOURCE_DATA_DIR}/../../LICENSE \
--hdiutil-verbose \
Expand Down
Binary file modified tools/osx/rtdmg-bkgd.png
Benitoite marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading