* CI: Fix CVE-2020-15228 in GitHub Actions Fixes the CVE-2020-15228 security issue in GitHub Actions: > `add-path` and `set-env` Runner commands are processed via stdout set-env was used twice, which is now replaced by >> $GITHUB_ENV - Issue: https://github.com/actions/toolkit/security/advisories/GHSA-mfwh-5m23-j46w - Solution: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable) * CI: Specify installing libsigc++ v2.x in GitHub Actions Version 3 of libsigc++ was automatically installed. This commit fixates the version brew installs to 2.x. Should fix #6002 * CI: Use v2 checkout and upload-artifact actions Also replaces macos-10.15 with macos-latest as runner. Currently is references the same environment (macOS 10.15), but this way it will update to macOS 11.0 when it's ready and stable.
97 lines
4.6 KiB
YAML
97 lines
4.6 KiB
YAML
name: macOS build
|
|
on:
|
|
push:
|
|
branches:
|
|
- dev
|
|
- patch**
|
|
- newlocallab
|
|
pull_request:
|
|
branches:
|
|
- dev
|
|
- newlocallab
|
|
release:
|
|
types:
|
|
- created
|
|
jobs:
|
|
build:
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- 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 libomp shared-mime-info | 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"'
|
|
- name: Configure build system
|
|
env:
|
|
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
|
|
RAW_THERAPEE_MAJOR: '5'
|
|
RAW_THERAPEE_MINOR: '8'
|
|
C_FLAGS: >
|
|
-arch x86_64 -mtune=generic -Xpreprocessor -fopenmp /usr/local/lib/libomp.dylib -I/usr/local/include -I/usr/local/opt/gdk-pixbuf/include -I/usr/local/opt/libiconv/include -I/usr/local/opt/libxml2/include -I/usr/local/opt/expat/include -I/usr/local/opt/libtiff/include
|
|
run: |
|
|
# GITHUB_REF is the ref that triggered the build, like
|
|
# refs/heads/new-feature - the next line parses that to REF: the branch
|
|
# name only (new-feature)
|
|
export REF=${GITHUB_REF##*/}
|
|
export C_FLAGS=$(echo -e $C_FLAGS | tr -d '\n')
|
|
cd build && date -u && date +%s > configstamp
|
|
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/libffi/lib -L/usr/local/opt/libffi/lib -L/usr/local/opt/libxml2/lib -L/usr/local/opt/expat/lib" \
|
|
-DCACHE_NAME_SUFFIX="${RAW_THERAPEE_MAJOR}.${RAW_THERAPEE_MINOR}-${REF}" \
|
|
-DPROC_TARGET_NUMBER="1" \
|
|
-DPROC_LABEL="generic processor" \
|
|
-DWITH_LTO="OFF" \
|
|
-DLENSFUNDBDIR="/Applications/RawTherapee.app/Contents/Resources/share/lensfun" \
|
|
-DCMAKE_C_COMPILER=/usr/local/opt/llvm/bin/clang \
|
|
-DCMAKE_CXX_COMPILER=/usr/local/opt/llvm/bin/clang++ \
|
|
-DCMAKE_C_FLAGS="-arch x86_64 -Wno-pass-failed -Wno-deprecated-register -Wno-unused-command-line-argument" \
|
|
-DCMAKE_CXX_FLAGS="-arch x86_64 -Wno-pass-failed -Wno-deprecated-register -Wno-unused-command-line-argument" \
|
|
-DOpenMP_C_FLAGS="${C_FLAGS}" \
|
|
-DOpenMP_CXX_FLAGS="${C_FLAGS}" \
|
|
-DOpenMP_C_LIB_NAMES=libomp \
|
|
-DOpenMP_CXX_LIB_NAMES=libomp \
|
|
-DOpenMP_libomp_LIBRARY=/usr/local/lib/libomp.dylib \
|
|
-DCMAKE_AR=/usr/bin/ar \
|
|
-DCMAKE_RANLIB=/usr/bin/ranlib \
|
|
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 \
|
|
..
|
|
zsh -c 'echo "Configured in $(printf "%0.2f" $(($[$(date +%s)-$(cat configstamp)]/$((60.))))) minutes"'
|
|
- 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"'
|
|
- 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
|
|
export ARTIFACT=(RawTherapee*.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"'
|
|
exit
|
|
- uses: actions/upload-artifact@v2
|
|
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"'
|