Nightly Win PKG #720
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Nightly Win PKG | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
jobs: | |
Win64: | |
if: github.repository == 'aurelienpierreeng/ansel' || github.event_name == 'workflow_dispatch' | |
name: Nightly Ansel Win64 build | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
btype: | |
- Release | |
eco: [-DBINARY_PACKAGE_BUILD=ON -DUSE_XMLLINT=OFF] | |
target: | |
- skiptest | |
generator: | |
- Ninja | |
branch: | |
- { code: "${{ github.ref_name }}", label: stable } | |
msystem: | |
- UCRT64 | |
defaults: | |
run: | |
shell: msys2 {0} | |
env: | |
SRC_DIR: ${{ github.workspace }}/src | |
BUILD_DIR: ${{ github.workspace }}/build | |
INSTALL_PREFIX: ${{ github.workspace }}/install | |
ECO: ${{ matrix.eco }} | |
CMAKE_BUILD_TYPE: ${{ matrix.btype }} | |
GENERATOR: ${{ matrix.generator }} | |
TARGET: ${{ matrix.target }} | |
BRANCH: ${{ matrix.branch.code }} | |
BUILD_NAME: ${{ matrix.branch.label }} | |
steps: | |
- uses: msys2/setup-msys2@v2 | |
with: | |
msystem: ${{ matrix.msystem }} | |
install: >- | |
git | |
intltool | |
po4a | |
pacboy: >- | |
cc:p | |
cmake:p | |
cmocka:p | |
curl:p | |
ninja:p | |
nsis:p | |
dbus-glib:p | |
drmingw:p | |
gcc-libs:p | |
gettext:p | |
gmic:p | |
graphicsmagick:p | |
gtk3:p | |
icu:p | |
imath:p | |
iso-codes:p | |
lcms2:p | |
lensfun:p | |
libavif:p | |
libexif:p | |
libheif:p | |
libjpeg-turbo:p | |
libjxl:p | |
librsvg:p | |
libsecret:p | |
libsoup:p | |
libwebp:p | |
libtiff:p | |
libwebp:p | |
libxml2:p | |
libxslt:p | |
lua:p | |
omp:p | |
openexr:p | |
openjpeg2:p | |
osm-gps-map:p | |
portmidi:p | |
pugixml:p | |
python:p | |
python-jsonschema:p | |
python-setuptools:p | |
python-six:p | |
sqlite3:p | |
zlib:p | |
update: true | |
- name: Checkout ansel source | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ env.BRANCH }} | |
fetch-depth: 2000 | |
fetch-tags: true | |
submodules: true | |
path: src | |
- name: Checkout exiv2 source | |
uses: actions/checkout@v3 | |
with: | |
repository: 'Exiv2/exiv2' | |
# Exiv2 0.28.0 removes the old `std::wstring` path for Windows, and | |
# breaks non-ASCII path handling. We stick to 0.27 until fixes in | |
# <https://github.com/Exiv2/exiv2/pull/2800> get merged. | |
ref: '0.27-maintenance' | |
path: 'exiv2-src' | |
fetch-depth: 1 | |
# Install manually compiled dependencies into MingW's prefix, so ansel | |
# will link against it and CPack will grab it. | |
# | |
# Exiv2 uses `CURL_LIBRARIES` which is only set by `FindCURL.cmake` module | |
# so we fix compatibility with `CURLConfig.cmake`. | |
- name: Manually build and install exiv2 | |
run: | | |
cd exiv2-src | |
sed -i 's/find_package(CURL REQUIRED)/find_package(CURL REQUIRED)\nif(TARGET CURL::libcurl)\nset(CURL_LIBRARIES CURL::libcurl)\nendif()/g' cmake/findDependencies.cmake | |
cmake -B build -G Ninja \ | |
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \ | |
-DEXIV2_ENABLE_VIDEO=OFF \ | |
-DEXIV2_ENABLE_NLS=ON \ | |
-DEXIV2_ENABLE_XMP=ON \ | |
-DEXIV2_ENABLE_CURL=ON \ | |
-DEXIV2_ENABLE_WEBREADY=ON \ | |
-DEXIV2_ENABLE_WIN_UNICODE=ON \ | |
-DEXIV2_ENABLE_BMFF=ON | |
ninja -C build | |
ninja -C build install | |
cd .. | |
- name: Update lensfun data | |
run: | | |
lensfun-update-data | |
- name: Build and Install | |
run: | | |
cmake -E make_directory "${BUILD_DIR}" | |
cmake -E make_directory "${INSTALL_PREFIX}" | |
$(cygpath ${SRC_DIR})/.ci/ci-script.sh | |
- name: Check if it runs | |
run: | | |
$(cygpath ${INSTALL_PREFIX})/bin/ansel.exe --version || true | |
$(cygpath ${INSTALL_PREFIX})/bin/ansel-cli.exe \ | |
--width 2048 --height 2048 \ | |
--hq true --apply-custom-presets false \ | |
$(cygpath ${SRC_DIR})/src/tests/integration/images/mire1.cr2 \ | |
$(cygpath ${SRC_DIR})/src/tests/integration/0000-nop/nop.xmp \ | |
output.png \ | |
--core --disable-opencl --conf host_memory_limit=8192 \ | |
--conf worker_threads=4 -t 4 \ | |
--conf plugins/lighttable/export/force_lcms2=FALSE \ | |
--conf plugins/lighttable/export/iccintent=0 | |
- name: Package | |
if: ${{ success() }} | |
run: | | |
cd "${BUILD_DIR}" | |
cmake --build "${BUILD_DIR}" --target package | |
- name: Package upload | |
if: ${{ success() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ansel.${{ env.BUILD_NAME }}.win64 | |
path: ${{ env.BUILD_DIR }}/ansel-*.exe | |
retention-days: 90 | |
upload_to_release: | |
runs-on: ubuntu-latest | |
needs: Win64 | |
env: | |
REPO: "https://github.com/aurelienpierreeng/ansel" | |
ROOM: "!SgRYbzspwqwwUgSQHC:matrix.org" | |
TAG: "v0.0.0" | |
steps: | |
- name: Checkout ansel source | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
submodules: false | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: ansel.stable.win64 | |
- name: Update nightly release | |
uses: aurelienpierreeng/tip@master | |
with: | |
tag: ${{ env.TAG }} | |
rm: false | |
token: ${{ secrets.GITHUB_TOKEN }} | |
files: ansel-*.exe | |
- name: Install dependencies | |
run: | | |
python -m pip install simplematrixbotlib | |
- name: Notify Matrix | |
if: ${{ success() }} | |
run: | | |
FILENAME=$(find . -type f -iname "ansel-*.exe") | |
MESSAGE="New Exe [${FILENAME}](${{ env.REPO }}/releases/download/${{ env.TAG }}/${FILENAME}) built" | |
python .ci/matrix.py \ | |
-m "$MESSAGE" \ | |
-s ${{ secrets.MATRIX_SERVER }} \ | |
-u ${{ secrets.MATRIX_USER }} \ | |
-t ${{ secrets.MATRIX_ACCESS }} \ | |
-r ${{ env.ROOM }} |