Skip to content

release

release #806

Workflow file for this run

on:
workflow_dispatch:
schedule:
- cron: 0 6 * * *
push:
tags:
- '*'
pull_request:
branches:
- main
paths:
- '.github/workflows/release.yml'
permissions:
contents: write
name: release
jobs:
create_app_image:
name: Create AppImage
runs-on: ubuntu-latest
container:
image: ubuntu:20.04
strategy:
matrix:
compiler: [ gcc, clang ]
include:
- compiler: gcc
cxx_compiler: g++
packages: gcc g++
- compiler: clang
cxx_compiler: clang++
packages: clang
steps:
- name: Install dependencies
run: |
set -e
export DEBIAN_FRONTEND=noninteractive
apt update -y
apt install -y autoconf curl fuse git kmod libbz2-dev libdjvulibre-dev libfontconfig-dev libfreetype6-dev libfribidi-dev libharfbuzz-dev liblcms-dev libopenexr-dev libopenjp2-7-dev libturbojpeg0-dev liblqr-dev libraqm-dev libtiff-dev libwebp-dev libx11-dev libxml2-dev liblzma-dev make software-properties-common wget ${{ matrix.packages }}
add-apt-repository ppa:git-core/ppa -y
apt install -y git
add-apt-repository ppa:strukturag/libheif -y
add-apt-repository ppa:strukturag/libde265 -y
apt install libheif-dev -y
- name: Checkout
uses: actions/checkout@v4
# Avoid fatal: detected dubious ownership in repository at '/__w/ImageMagick/ImageMagick'
# Possible workaround: https://github.com/actions/runner/issues/2033#issuecomment-1598547465
- name: Flag current workspace as safe for git
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Download AppImage
run: |
mkdir /app-image
cd /app-image
wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
chmod a+x linuxdeployqt-continuous-x86_64.AppImage
./linuxdeployqt-continuous-x86_64.AppImage --appimage-extract
- name: Build ImageMagick
env:
CFLAGS: -Wno-deprecated-declarations -Wdeclaration-after-statement -Wno-error=unused-variable
CC: ${{ matrix.compiler }}
CXX: ${{ matrix.cxx_compiler }}
run: |
set -e
./configure --with-quantum-depth=16 --without-magick-plus-plus --without-perl --prefix=/usr
make
make install DESTDIR=$(readlink -f /appdir)
- name: Create ImageMagick AppImage
run: |
set -e
mkdir -p /appdir/usr/share/applications/
cp ./app-image/imagemagick.desktop /appdir/usr/share/applications/
mkdir -p /appdir/usr/share/icons/hicolor/128x128/apps/
cp ./app-image/icon.png /appdir/usr/share/icons/hicolor/128x128/apps/imagemagick.png
unset QTDIR
unset QT_PLUGIN_PATH
unset LD_LIBRARY_PATH
export VERSION=$(git rev-parse --short HEAD)-${{ matrix.compiler }}
/app-image/linuxdeployqt-continuous-x86_64.AppImage --appimage-extract-and-run /appdir/usr/share/applications/imagemagick.desktop -bundle-non-qt-libs
rm /appdir/AppRun
cp ./app-image/AppRun /appdir
chmod a+x /appdir/AppRun
PATH=/app-image/squashfs-root/usr/bin:$PATH
/app-image/squashfs-root/usr/bin/appimagetool -g /appdir/
mkdir artifacts
cp ImageMagick-$VERSION-x86_64.AppImage artifacts
find /appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq
- name: Upload ImageMagick AppImage
uses: actions/upload-artifact@v4
with:
name: AppImage-${{ matrix.compiler }}
path: artifacts
build_windows:
name: 'Build ${{ matrix.quantum }}${{ matrix.hdri_flag }} (${{ matrix.platform }})'
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
platform: [ x64, arm64 ]
quantum: [ Q16 ]
hdri: [ HDRI ]
exclude:
- quantum: Q8
hdri: HDRI
include:
- hdri: HDRI
hdri_flag: '-HDRI'
steps:
- name: Clone ImageMagick
uses: actions/checkout@v4
with:
path: ImageMagick
- name: Clone ImageMagick-Windows
uses: actions/checkout@v4
with:
repository: ImageMagick/ImageMagick-Windows
path: ImageMagick-Windows
- name: Clone repositories
shell: cmd
run: |
cd ImageMagick-Windows
CloneRepositories.IM7.cmd
- name: Build configure
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat"
cd ImageMagick-Windows\Configure
msbuild Configure.sln /m /t:Rebuild /p:Configuration=Release,Platform=x64
- name: Configure ImageMagick
shell: cmd
run: |
cd ImageMagick-Windows\Configure
Configure.exe /VS2022 /noWizard /noAliases /${{ matrix.hdri }} /${{ matrix.quantum }} /${{ matrix.platform }} /smtd
- name: Build ImageMagick (${{ matrix.platform }})
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat"
cd ImageMagick-Windows
msbuild /m /t:Rebuild /p:Configuration=Release,Platform=${{matrix.platform}}
- uses: actions/upload-artifact@v4
with:
name: Windows-${{matrix.quantum}}${{matrix.hdri_flag}}-${{matrix.platform}}
path: |
ImageMagick-Windows\Output\bin\*.xml
ImageMagick-Windows\Output\bin\*.exe
version:
name: Set release and version
runs-on: windows-latest
outputs:
release: ${{ steps.version.outputs.release }}
version: ${{ steps.version.outputs.version }}
steps:
- name: Clone ImageMagick
uses: actions/checkout@v4
with:
path: ImageMagick
- name: Set release and version
id: version
run: |
$release = (Get-Content ImageMagick\configure -Raw) | Select-String -Pattern "PACKAGE_VERSION='([0-9\.-]*)" -AllMatches | % { $_.Matches } | % { $_.Groups[1].Value }
$version = $release -replace '-', '.'
echo "release=$release" >> $env:GITHUB_OUTPUT
echo "version=$version" >> $env:GITHUB_OUTPUT
create_msix:
name: 'Create Msix ${{matrix.quantum}}${{matrix.hdri_flag}}'
runs-on: windows-latest
needs:
- version
- build_windows
strategy:
fail-fast: false
matrix:
quantum: [ Q16 ]
hdri: [ HDRI ]
exclude:
- quantum: Q8
hdri: HDRI
include:
- hdri: HDRI
hdri_flag: '-HDRI'
steps:
- name: Clone ImageMagick-Windows
uses: actions/checkout@v4
with:
repository: ImageMagick/ImageMagick-Windows
path: ImageMagick-Windows
- name: Download x64 artifacts
uses: actions/download-artifact@v4
with:
name: Windows-${{matrix.quantum}}${{matrix.hdri_flag}}-x64
path: ImageMagick-Windows\Installer\Msix\x64
- name: Download arm64 artifacts
uses: actions/download-artifact@v4
with:
name: Windows-${{matrix.quantum}}${{matrix.hdri_flag}}-arm64
path: ImageMagick-Windows\Installer\Msix\arm64
- name: Create msixbundle with Advanced Installer
if: github.event_name != 'pull_request'
env:
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
uses: caphyon/advinst-github-action@v1.1
with:
advinst-license: ${{ secrets.ADVINST_LICENSE_KEY }}
aip-path: ImageMagick-Windows\Installer\Msix\ImageMagick.${{matrix.quantum}}${{matrix.hdri_flag}}.aip
aip-build-name: Build_MSIX
aip-commands: |
SetVersion ${{ needs.version.outputs.version }}
- uses: actions/upload-artifact@v4
if: github.event_name != 'pull_request'
with:
name: Msix-${{matrix.quantum}}${{matrix.hdri_flag}}
path: 'ImageMagick-Windows\Installer\Msix\Output\ImageMagick.${{matrix.quantum}}${{matrix.hdri_flag}}.msixbundle'
create_release:
name: Create Release
if: startsWith(github.ref, 'refs/tags/')
needs:
- create_app_image
- create_msix
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Publish release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
artifacts/AppImage-clang/ImageMagick-*-clang-x86_64.AppImage
artifacts/AppImage-gcc/ImageMagick-*-gcc-x86_64.AppImage
artifacts/Msix-Q16-HDRI/ImageMagick.Q16-HDRI.msixbundle
publish_msix:
name: 'Publish Msix ${{matrix.quantum}}${{matrix.hdri_flag}}'
if: startsWith(github.ref, 'refs/tags/')
needs:
- version
- create_release
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
quantum: [ Q16 ]
hdri: [ HDRI ]
exclude:
- quantum: Q8
hdri: HDRI
include:
- hdri: HDRI
hdri_flag: '-HDRI'
steps:
- name: Install winget
uses: Cyberboss/install-winget@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install wingetcreate
run: winget install wingetcreate --disable-interactivity --accept-source-agreements
- name: Update manifest on winget
run: wingetcreate update --submit --replace --token ${{ secrets.WINGET_TOKEN }} --urls https://github.com/ImageMagick/ImageMagick/releases/download/${{ needs.version.outputs.release }}/ImageMagick.${{matrix.quantum}}${{matrix.hdri_flag}}.msixbundle --version ${{ needs.version.outputs.version }} ImageMagick.${{matrix.quantum}}${{matrix.hdri_flag}}