forked from ImageMagick/ImageMagick
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Static builds for Linux ARM and x64 + Download Windows Portable builds
This is a workflow based on the upstream workflow, release.yml. It is needed because: - Upstream doesn't publish ARM64 binaries for Linux - The Windows portable releases are not part of the artifacts attached to the GitHub release The goal here is to have 4 standalone binaries - Linux x64, Linux ARM, Win x64, Win ARM. These are cobbled together and attached to a draft release which we can then publish and use to pull these binaries.
- Loading branch information
Showing
6 changed files
with
175 additions
and
49 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
on: | ||
workflow_dispatch: | ||
push: # Push a tag to build and create a draft release | ||
tags: | ||
- "*" | ||
|
||
name: binaries-for-ente | ||
jobs: | ||
create_magick_binary: | ||
name: Create magick binary (Linux) | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-24.04, ubuntu-24.04-arm] | ||
compiler: [gcc] | ||
include: | ||
- os: ubuntu-24.04 | ||
arch: x86_64 | ||
- os: ubuntu-24.04-arm | ||
arch: aarch64 | ||
- compiler: gcc | ||
cxx_compiler: g++ | ||
packages: gcc g++ | ||
|
||
steps: | ||
- name: Install dependencies | ||
run: | | ||
set -e | ||
export DEBIAN_FRONTEND=noninteractive | ||
sudo apt update -y | ||
sudo 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 }} | ||
sudo add-apt-repository ppa:git-core/ppa -y | ||
sudo apt install -y git | ||
sudo add-apt-repository ppa:strukturag/libheif -y | ||
sudo add-apt-repository ppa:strukturag/libde265 -y | ||
sudo 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: | | ||
set -e | ||
sudo apt install -y file | ||
mkdir -p out/app-image | ||
cd out/app-image | ||
wget -c https://github.com/$(wget -q https://github.com/probonopd/go-appimage/releases/expanded_assets/continuous -O - | grep "appimagetool-.*-${{ matrix.arch }}.AppImage" | head -n 1 | cut -d '"' -f 2) | ||
chmod +x appimagetool-*.AppImage | ||
- 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 --without-x --disable-docs --prefix=/usr | ||
make | ||
make install DESTDIR=$(readlink -f out/appdir) | ||
- name: Create ImageMagick AppImage | ||
run: | | ||
set -e | ||
mkdir -p out/appdir/usr/share/applications/ | ||
cp app-image/imagemagick.desktop out/appdir/usr/share/applications/ | ||
mkdir -p out/appdir/usr/share/icons/hicolor/256x256/apps/ | ||
cp app-image/icon.png out/appdir/usr/share/icons/hicolor/256x256/apps/imagemagick.png | ||
unset QTDIR | ||
unset QT_PLUGIN_PATH | ||
unset LD_LIBRARY_PATH | ||
export VERSION=7 | ||
cd out | ||
./app-image/appimagetool-*.AppImage --appimage-extract-and-run -s deploy appdir/usr/share/applications/*.desktop | ||
chmod +x appdir/usr/lib/ld-linux-aarch64.so.1 || true | ||
./app-image/appimagetool-*.AppImage --appimage-extract-and-run appdir | ||
mkdir artifacts | ||
cp ImageMagick*.AppImage artifacts/magick-${{ matrix.arch }} | ||
- name: Upload ImageMagick AppImage | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: magick-${{ matrix.arch }} | ||
path: out/artifacts | ||
|
||
- name: Create a draft GitHub release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: "out/artifacts/*" | ||
draft: true | ||
allowUpdates: true | ||
updateOnlyUnreleased: true | ||
|
||
download_and_keep_windows_binaries: | ||
name: Download magick binary (Windows) | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Download | ||
run: | | ||
mkdir -p out/artifacts | ||
curl -LO https://imagemagick.org/archive/binaries/ImageMagick-7.1.1-43-portable-Q16-x64.zip | ||
unzip ImageMagick-7.1.1-43-portable-Q16-x64.zip | ||
cp ImageMagick-7.1.1-43-portable-Q16-x64/magick.exe out/artifacts/magick-x64.exe | ||
curl -LO https://imagemagick.org/archive/binaries/ImageMagick-7.1.1-43-portable-Q16-arm64.zip | ||
unzip ImageMagick-7.1.1-43-portable-Q16-arm64.zip | ||
cp ImageMagick-7.1.1-43-portable-Q16-arm64/magick.exe out/artifacts/magick-arm64.exe | ||
- name: Upload ImageMagick exes | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: magick-${{ matrix.arch }} | ||
path: out/artifacts | ||
|
||
- name: Create a draft GitHub release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: "out/artifacts/*" | ||
draft: true | ||
allowUpdates: true | ||
updateOnlyUnreleased: true |
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
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
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
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
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