Merge branch 'dev' into ci-maint

This commit is contained in:
Beep6581
2023-08-28 23:18:04 +02:00
committed by GitHub
357 changed files with 22504 additions and 23678 deletions

View File

@@ -11,6 +11,9 @@ on:
- dev
workflow_dispatch:
env:
publish_pre_dev_labels: '[]'
jobs:
build:
runs-on: ubuntu-20.04
@@ -29,7 +32,21 @@ jobs:
echo "Running apt update."
sudo apt update
echo "Installing dependencies with apt."
DEBIAN_FRONTEND=noninteractive sudo apt install -y cmake libgtk-3-dev libgtkmm-3.0-dev liblensfun-dev librsvg2-dev liblcms2-dev libfftw3-dev libiptcdata0-dev libtiff5-dev libcanberra-gtk3-dev liblensfun-bin
DEBIAN_FRONTEND=noninteractive sudo apt install -y cmake libgtk-3-dev libgtkmm-3.0-dev liblensfun-dev librsvg2-dev liblcms2-dev libfftw3-dev libiptcdata0-dev libtiff5-dev libcanberra-gtk3-dev liblensfun-bin libexpat1-dev libbrotli-dev zlib1g-dev libinih-dev
- name: Install Exiv2
run: |
EXIV2_VERSION='v0.28.0'
echo "Cloning Exiv2 $EXIV2_VERSION."
git clone --depth 1 --branch "$EXIV2_VERSION" https://github.com/Exiv2/exiv2.git ext/exiv2
echo "Configuring build."
mkdir ext/exiv2/build
cd ext/exiv2/build
cmake -DCMAKE_BUILD_TYPE=Release -DEXIV2_ENABLE_BMFF=ON ..
echo "Building and installing."
sudo make -j$(nproc) install
- name: Configure build
run: |
@@ -112,6 +129,9 @@ jobs:
- name: Package AppImage
working-directory: ./build
run: |
echo "LD_LIBRARY_PATH is '$LD_LIBRARY_PATH'. Adding /usr/local/lib."
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/lib"
echo "Creating artifact name."
if [ '${{github.ref_type}}' == 'tag' ]; then
ARTIFACT_NAME="RawTherapee_${REF_NAME_FILTERED}_${{matrix.build_type}}"
@@ -168,3 +188,33 @@ jobs:
files: |
${{env.PUBLISH_NAME}}.AppImage
${{env.PUBLISH_NAME}}-AboutThisBuild.txt
- name: Prepare for publishing pre-dev
id: prepare-publish-pre-dev
if: ${{github.event_name == 'pull_request' && contains(fromJSON(env.publish_pre_dev_labels), github.event.pull_request.head.label)}}
run: |
echo "Making ref name."
REF_NAME_FILTERED="$(echo '${{github.event.pull_request.head.label}}' | tr ':' '_' | sed 's/[^A-z0-9_.-]//g')"
echo "Ref name is '$REF_NAME_FILTERED'."
echo "Setting publish name."
PUBLISH_NAME="RawTherapee_${REF_NAME_FILTERED}_${{matrix.build_type}}"
echo "Publish name is '$PUBLISH_NAME'."
echo "Renaming AppImage."
cp "build/$ARTIFACT_NAME.AppImage" "$PUBLISH_NAME.AppImage"
echo "Creating version file."
cp "build/AboutThisBuild.txt" "$PUBLISH_NAME-AppImage-AboutThisBuild.txt"
echo "Recording publish name."
echo "PUBLISH_NAME=$PUBLISH_NAME" >> $GITHUB_ENV
- name: Publish pre-dev artifacts
uses: softprops/action-gh-release@v1
if: ${{steps.prepare-publish-pre-dev.outcome == 'success'}}
with:
tag_name: pre-dev-github-actions
files: |
${{env.PUBLISH_NAME}}.AppImage
${{env.PUBLISH_NAME}}-AppImage-AboutThisBuild.txt

89
.github/workflows/codeql.yml vendored Normal file
View File

@@ -0,0 +1,89 @@
name: "CodeQL"
on:
push:
branches: [ 'dev' ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ 'dev' ]
schedule:
- cron: '56 5 * * 1'
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
build_type: [release]
language: [ 'cpp', 'python' ]
steps:
- name: Checkout source
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install dependencies
run: |
echo "Running apt update."
sudo apt update
echo "Installing dependencies with apt."
DEBIAN_FRONTEND=noninteractive sudo apt install -y cmake libgtk-3-dev libgtkmm-3.0-dev liblensfun-dev librsvg2-dev liblcms2-dev libfftw3-dev libiptcdata0-dev libtiff5-dev libcanberra-gtk3-dev liblensfun-bin libexiv2-dev
- name: Configure build
run: |
export REF_NAME_FILTERED="$(echo '${{github.ref_name}}' | sed 's/[^A-z0-9_.-]//g')"
echo "Setting cache suffix."
if [ '${{github.ref_type}}' == 'tag' ]; then
export CACHE_SUFFIX=""
else
export CACHE_SUFFIX="5-$REF_NAME_FILTERED"
fi
export CACHE_SUFFIX="$CACHE_SUFFIX-AppImage"
echo "Cache suffix is '$CACHE_SUFFIX'."
echo "Making build directory."
mkdir build
echo "Changing working directory to the build directory."
cd build
echo "Running CMake configure."
cmake \
-DCMAKE_BUILD_TYPE='${{matrix.build_type}}' \
-DCACHE_NAME_SUFFIX="$CACHE_SUFFIX" \
-DPROC_TARGET_NUMBER="1" \
-DBUILD_BUNDLE="ON" \
-DBUNDLE_BASE_INSTALL_DIR="/" \
-DOPTION_OMP="ON" \
-DWITH_LTO="OFF" \
-DWITH_PROF="OFF" \
-DWITH_SAN="OFF" \
-DWITH_SYSTEM_KLT="OFF" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DLENSFUNDBDIR="../share/lensfun/version_1" \
..
echo "Recording filtered ref name."
echo "REF_NAME_FILTERED=$REF_NAME_FILTERED" >> $GITHUB_ENV
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Build RawTherapee
working-directory: ./build
run: |
echo "Running make install."
make -j$(nproc) install DESTDIR=AppDir/usr/bin
echo "Moving usr/bin/share to usr/share."
mv AppDir/usr/bin/share AppDir/usr/
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"

View File

@@ -22,7 +22,7 @@ jobs:
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 | tee -a depslog
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 | tee -a depslog
date -u
echo "----====Pourage====----"
cat depslog | grep Pouring
@@ -49,6 +49,7 @@ jobs:
-DCACHE_NAME_SUFFIX="${RAW_THERAPEE_MAJOR}.${RAW_THERAPEE_MINOR}-${REF}" \
-DPROC_TARGET_NUMBER="1" \
-DPROC_LABEL="generic processor" \
-DCMAKE_OSX_ARCHITECTURES=$(uname -m) \
-DWITH_LTO="OFF" \
-DLENSFUNDBDIR="/Applications/RawTherapee.app/Contents/Resources/share/lensfun" \
-DCMAKE_C_COMPILER=clang \
@@ -62,9 +63,10 @@ jobs:
-DOpenMP_libomp_LIBRARY=/usr/local/lib/libomp.dylib \
-DCMAKE_AR=/usr/bin/ar \
-DCMAKE_RANLIB=/usr/bin/ranlib \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
-DOSX_CONTINUOUS=ON \
..
curl -L https://github.com/Homebrew/homebrew-core/raw/679923b4eb48a8dc7ecc1f05d06063cd79b3fc00/Formula/libomp.rb -o libomp.rb && brew install libomp.rb
curl -L https://github.com/Homebrew/homebrew-core/raw/679923b4eb48a8dc7ecc1f05d06063cd79b3fc00/Formula/libomp.rb -o libomp.rb && brew install --formula libomp.rb
zsh -c 'echo "Configured in $(printf "%0.2f" $(($[$(date +%s)-$(cat configstamp)]/$((60.))))) minutes"'
- name: Compile RawTherapee
run: |
@@ -78,7 +80,7 @@ jobs:
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)
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

View File

@@ -11,6 +11,9 @@ on:
- dev
workflow_dispatch:
env:
publish_pre_dev_labels: '[]'
jobs:
build:
runs-on: windows-latest
@@ -46,6 +49,7 @@ jobs:
mingw-w64-x86_64-fftw
mingw-w64-x86_64-lensfun
mingw-w64-x86_64-libiptcdata
mingw-w64-x86_64-exiv2
- name: Configure build
run: |
@@ -95,6 +99,12 @@ jobs:
- name: Bundle dependencies
run: |
echo "Listing shared library dependencies."
ldd "./build/${{matrix.build_type}}/rawtherapee.exe"
echo "Finding DLLs to include."
DLLS=($(ldd "./build/${{matrix.build_type}}/rawtherapee.exe" | grep '/mingw64/bin/' | awk '{print($1)'}))
echo "Required DLLs are: ${DLLS[*]}"
echo "Getting workspace path."
export BUILD_DIR="$(pwd)/build/${{matrix.build_type}}"
echo "Build directory is '$BUILD_DIR'."
@@ -107,81 +117,22 @@ jobs:
"gdbus.exe" \
"gspawn-win64-helper.exe" \
"gspawn-win64-helper-console.exe" \
"libatk-1.0-0.dll" \
"libatkmm-1.6-1.dll" \
"libbrotlicommon.dll" \
"libbrotlidec.dll" \
"libbz2-1.dll" \
"libcairo-2.dll" \
"libcairo-gobject-2.dll" \
"libcairomm-1.0-1.dll" \
"libdatrie-1.dll" \
"libdeflate.dll" \
"libepoxy-0.dll" \
"libexpat-1.dll" \
libffi-*.dll \
"libfftw3f-3.dll" \
"libfontconfig-1.dll" \
"libfreetype-6.dll" \
"libfribidi-0.dll" \
"libgcc_s_seh-1.dll" \
"libgdk_pixbuf-2.0-0.dll" \
"libgdk-3-0.dll" \
"libgdkmm-3.0-1.dll" \
"libgio-2.0-0.dll" \
"libgiomm-2.4-1.dll" \
"libglib-2.0-0.dll" \
"libglibmm-2.4-1.dll" \
"libgmodule-2.0-0.dll" \
"libgobject-2.0-0.dll" \
"libgomp-1.dll" \
"libgraphite2.dll" \
"libgtk-3-0.dll" \
"libgtkmm-3.0-1.dll" \
"libharfbuzz-0.dll" \
"libiconv-2.dll" \
"libintl-8.dll" \
"libjbig-0.dll" \
"libjpeg-8.dll" \
"liblcms2-2.dll" \
"liblensfun.dll" \
"libLerc.dll" \
"liblzma-5.dll" \
"libpango-1.0-0.dll" \
"libpangocairo-1.0-0.dll" \
"libpangoft2-1.0-0.dll" \
"libpangomm-1.4-1.dll" \
"libpangowin32-1.0-0.dll" \
"libpcre2-8-0.dll" \
"libpixman-1-0.dll" \
"libpng16-16.dll" \
"librsvg-2-2.dll" \
"libsigc-2.0-0.dll" \
"libstdc++-6.dll" \
"libsystre-0.dll" \
"libthai-0.dll" \
"libtiff-5.dll" \
"libtre-5.dll" \
"libwebp-7.dll" \
"libwinpthread-1.dll" \
"libxml2-2.dll" \
"libzstd.dll" \
"zlib1.dll" \
${DLLS[*]} \
"$BUILD_DIR"
cd -
echo "Copying Adwaita theme."
mkdir -p "$BUILD_DIR/share/icons/Adwaita"
cd 'share/icons/Adwaita/'
mkdir -p "$BUILD_DIR/share/icons/Adwaita/scalable"
mkdir -p "$BUILD_DIR/share/icons/Adwaita/symbolic"
cp -r \
"scalable/actions" \
"scalable/devices" \
"scalable/mimetypes" \
"scalable/places" \
"scalable/status" \
"scalable/ui" \
"$BUILD_DIR/share/icons/Adwaita/scalable"
"symbolic/actions" \
"symbolic/devices" \
"symbolic/mimetypes" \
"symbolic/places" \
"symbolic/status" \
"symbolic/ui" \
"$BUILD_DIR/share/icons/Adwaita/symbolic"
cp 'index.theme' "$BUILD_DIR/share/icons/Adwaita"
mkdir -p "$BUILD_DIR/share/icons/Adwaita/cursors"
cp -r \
@@ -203,7 +154,7 @@ jobs:
echo "Creating GTK settings.ini."
mkdir -p "$BUILD_DIR/share/gtk-3.0/"
echo '[Settings] gtk-button-images=1' > "$BUILD_DIR/share/gtk-3.0/settings.ini"
echo -e '[Settings]\ngtk-button-images=1' > "$BUILD_DIR/share/gtk-3.0/settings.ini"
- name: Create installer
if: ${{matrix.build_type == 'release' && (github.ref_type == 'tag' || github.ref_name == 'dev')}}
@@ -297,3 +248,44 @@ jobs:
with:
tag_name: nightly-github-actions
files: build/${{env.PUBLISH_NAME}}.exe
- name: Prepare for publishing pre-dev
id: prepare-publish-pre-dev
if: ${{github.event_name == 'pull_request' && contains(fromJSON(env.publish_pre_dev_labels), github.event.pull_request.head.label)}}
run: |
echo "Making ref name."
REF_NAME_FILTERED="$(echo '${{github.event.pull_request.head.label}}' | tr ':' '_' | sed 's/[^A-z0-9_.-]//g')"
echo "Ref name is '$REF_NAME_FILTERED'."
echo "Setting publish name."
PUBLISH_NAME="RawTherapee_${REF_NAME_FILTERED}_win64_${{matrix.build_type}}"
echo "Publish name is '$PUBLISH_NAME'."
if [ "$ARTIFACT_NAME" != "$PUBLISH_NAME" ]; then
echo "Renaming ZIP file."
cp "build/$ARTIFACT_NAME.zip" "build/$PUBLISH_NAME.zip"
if [ -e "./build/$ARTIFACT_NAME.exe" ]; then
echo "Renaming installer."
mv "./build/$ARTIFACT_NAME.exe" "./build/$PUBLISH_NAME.exe"
fi
fi
echo "Creating version file."
cp "build/$ARTIFACT_NAME/AboutThisBuild.txt" "build/$PUBLISH_NAME-AboutThisBuild.txt"
echo "Recording publish name."
echo "PUBLISH_NAME=$PUBLISH_NAME" >> "$(cygpath -u $GITHUB_ENV)"
- name: Publish pre-dev artifacts
uses: softprops/action-gh-release@v1
if: ${{steps.prepare-publish-pre-dev.outcome == 'success'}}
with:
tag_name: pre-dev-github-actions
files: |
build/${{env.PUBLISH_NAME}}.zip
build/${{env.PUBLISH_NAME}}-AboutThisBuild.txt
- name: Publish pre-dev installer
uses: softprops/action-gh-release@v1
if: ${{steps.prepare-publish-pre-dev.outcome == 'success' && matrix.build_type == 'release'}}
with:
tag_name: pre-dev-github-actions
files: build/${{env.PUBLISH_NAME}}.exe