diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 824d87d1d..6f601d4e8 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -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: > @@ -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++ \ @@ -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}" \ @@ -103,15 +110,23 @@ 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'}} @@ -119,24 +134,30 @@ jobs: 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: > @@ -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" \ @@ -170,28 +191,31 @@ 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}" \ @@ -199,6 +223,7 @@ jobs: "ARTIFACT_FILE: ${ARTIFACT_FILE}" \ "PUBLISH_NAME: ${PUBLISH_NAME}" exit + - uses: actions/upload-artifact@v4 with: name: ${{env.ARTIFACT_FILE}} @@ -206,12 +231,23 @@ 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 + 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'}} diff --git a/tools/osx/macosx_bundle.sh b/tools/osx/macosx_bundle.sh index aaceb27be..d6f460904 100644 --- a/tools/osx/macosx_bundle.sh +++ b/tools/osx/macosx_bundle.sh @@ -394,6 +394,7 @@ 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 { @@ -401,7 +402,6 @@ function CreateDmg { msg "Preparing disk image sources at ${srcDir}:" cp -R "${APP}" "${srcDir}" - cp "${RESOURCES}"/LICENSE "${srcDir}" ln -s /Applications "${srcDir}" # Web bookmarks @@ -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 \ diff --git a/tools/osx/rtdmg-bkgd.png b/tools/osx/rtdmg-bkgd.png index 23d434290..88e441ff8 100644 Binary files a/tools/osx/rtdmg-bkgd.png and b/tools/osx/rtdmg-bkgd.png differ