-
Notifications
You must be signed in to change notification settings - Fork 0
181 lines (163 loc) 路 7.33 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
name: Build
on:
workflow_dispatch:
pull_request:
branches: [main]
push:
tags:
- "*"
schedule:
- cron: "0 0 1 * *"
jobs:
build:
name: "Build (${{ matrix.ubuntu-version }})"
runs-on: ubuntu-latest
strategy:
matrix:
ubuntu-version:
- focal
- jammy
libde265-version: ["1.0.8"]
libheif-version: ["1.13.0"]
imagemagick-version: ["7.1.0-51"]
imagemagick-dependencies: ["libbz2-dev libfontconfig1-dev libfreetype-dev libgs-dev liblcms2-dev liblzma-dev libopenexr-dev libopenjp2-7-dev libjpeg-turbo8-dev libpng-dev liblqr-1-0-dev libglib2.0-dev libraw-dev libtiff-dev libwebp-dev libxml2-dev libx11-dev libx265-dev libaom-dev zlib1g libltdl7"]
container:
image: ubuntu:${{ matrix.ubuntu-version }}
options: --user root
steps:
- name: Create binaries folder
run: mkdir binaries
- name: Install build dependencies
run: >
export DEBIAN_FRONTEND=noninteractive &&
apt-get update &&
apt-get -y install
autoconf
build-essential
checkinstall
curl
git
libtool
pkg-config
software-properties-common
wget
- name: Install ImageMagick format dependencies
run: apt-get -y install ${{ matrix.imagemagick-dependencies }}
- name: Build libde265 ${{ matrix.libde265-version }} from source
run: |
git clone --depth 1 --branch v${{ matrix.libde265-version }} https://github.com/strukturag/libde265.git
cd libde265
./autogen.sh
./configure
make
checkinstall --pkgversion="${{ matrix.libde265-version }}"
mv libde265_*.deb ../binaries/
- name: Build libheif ${{ matrix.libheif-version }} from source
run: |
git clone --depth 1 --branch v${{ matrix.libheif-version }} https://github.com/strukturag/libheif.git
cd libheif
./autogen.sh
./configure
make
checkinstall --pkgversion="${{ matrix.libheif-version }}"
mv libheif_*.deb ../binaries/
- name: Check ImageMagick dependencies
run: |
pkg-config --exists --print-errors "fontconfig >= 2.1.0" && echo "fontconfig succeeded" || echo "fontconfig failed"
pkg-config --exists --print-errors "freetype2 >= 2.8.0" && echo "freetype2 succeeded" || echo "freetype2 failed"
pkg-config --exists --print-errors "lcms2 >= 2.0.0" && echo "lcms2 succeeded" || echo "lcms2 failed"
pkg-config --exists --print-errors "libde265 >= 1.0.8" && echo "libde265 succeeded" || echo "libde265 failed"
pkg-config --exists --print-errors "libheif >= 1.13.0" && echo "libheif succeeded" || echo "libheif failed"
pkg-config --exists --print-errors "liblzma >= 2.9.0" && echo "liblzma succeeded" || echo "liblzma failed"
pkg-config --exists --print-errors "libopenjp2 >= 2.1.0" && echo "libopenjp2 succeeded" || echo "libopenjp2 failed"
pkg-config --exists --print-errors "libpng >= 1.0.0" && echo "libpng succeeded" || echo "libpng failed"
pkg-config --exists --print-errors "libtiff-4 >= 4.0.0" && echo "libtiff-4 succeeded" || echo "libtiff-4 failed"
pkg-config --exists --print-errors "libraw_r >= 0.14.8" && echo "libraw_r succeeded" || echo "libraw_r failed"
pkg-config --exists --print-errors "libwebp >= 0.6.1" && echo "libwebp succeeded" || echo "libwebp failed"
pkg-config --exists --print-errors "libwebpdemux >= 0.5.0" && echo "libwebpdemux succeeded" || echo "libwebpdemux failed"
pkg-config --exists --print-errors "libwebpmux >= 0.5.0" && echo "libwebpmux succeeded" || echo "libwebpmux failed"
pkg-config --exists --print-errors "libxml-2.0 >= 2.0.0" && echo "libxml-2.0 succeeded" || echo "libxml-2.0 failed"
pkg-config --exists --print-errors "lqr-1 >= 0.1.0" && echo "lqr-1 succeeded" || echo "lqr-1 failed"
pkg-config --exists --print-errors "OpenEXR >= 1.0.6" && echo "OpenEXR succeeded" || echo "OpenEXR failed"
pkg-config --exists --print-errors "zlib >= 1.0.0" && echo "zlib succeeded" || echo "zlib failed"
- name: Build ImageMagick ${{ matrix.imagemagick-version }} from source
run: >
git clone --depth 1 --branch ${{ matrix.imagemagick-version }} https://github.com/ImageMagick/ImageMagick.git imagemagick &&
cd imagemagick &&
./configure
--disable-dependency-tracking
--disable-opencl
--disable-silent-rules
--enable-shared
--enable-openmp
--enable-static
--with-bzlib=yes
--with-fontconfig=yes
--with-freetype=yes
--with-gslib=yes
--with-lqr=yes
--with-gvc=no
--with-heic=yes
--with-modules
--with-openexr=yes
--with-openjp2
--with-raw=yes
--with-webp=yes
--with-xml=yes
--without-fftw
--without-pango
--without-wmf &&
make &&
checkinstall
--pkgversion=$(echo "${{ matrix.imagemagick-version }}" | cut -d- -f1)
--pkgrelease=$(echo "${{ matrix.imagemagick-version }}" | cut -d- -f2)
--requires=$(echo "${{ matrix.imagemagick-dependencies }}" | tr -s '[:blank:]' ',') &&
ldconfig &&
mv imagemagick_*.deb ../binaries/
- name: magick --version
run: magick --version
- name: magick -list format
run: magick -list format
- name: Prefix binaries with Ubuntu version
run: cd binaries && for f in * ; do mv -- "$f" "${{ matrix.ubuntu-version }}_$f" ; done
- name: List binaries
run: ls binaries
- name: Archive binary artifacts
uses: actions/upload-artifact@v3
with:
name: binaries
path: binaries
- name: Upload binaries to GitHub Release
if: contains(github.ref, 'tags')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -e
wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
bash ./upload.sh binaries/*
- uses: actions/checkout@v3.1.0
if: github.event_name == 'pull_request' && matrix.ubuntu-version == 'jammy'
- name: Update README
if: github.event_name == 'pull_request' && matrix.ubuntu-version == 'jammy'
run: |
sed -i '/#### Example Output/q' ./README.md
echo '```' >> README.md
echo '$ magick --version' >> README.md
magick --version >> README.md
echo '```' >> README.md
echo '' >> README.md
echo '```' >> README.md
echo '$ magick -list format' >> README.md
magick -list format >> README.md
echo '```' >> README.md
- name: Update Pull Request
if: github.event_name == 'pull_request' && matrix.ubuntu-version == 'jammy'
uses: peter-evans/create-pull-request@v4.2.0
with:
token: ${{ secrets.PAT }}
commit-message: 'Update README [skip ci]'
committer: 'Nikolas Evers <vintagesucks@users.noreply.github.com>'
branch: '${{ github.ref_name }}'
delete-branch: true
title: '${{ github.event.pull_request.title }}'
body: '${{ github.event.pull_request.body }}'