forked from ImageMagick/ImageMagick
-
Notifications
You must be signed in to change notification settings - Fork 0
307 lines (268 loc) Β· 9.96 KB
/
release.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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
on:
workflow_dispatch:
schedule:
- cron: 0 6 * * *
push:
tags:
- '*'
pull_request:
branches:
- main
paths:
- '.github/workflows/release.yml'
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: [ Q8, Q16 ]
hdri: [ HDRI, noHDRI ]
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\Artifacts\bin\*.xml
ImageMagick-Windows\Artifacts\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
environment: release
needs:
- version
- build_windows
permissions:
id-token: write
contents: read
strategy:
fail-fast: false
matrix:
quantum: [ Q8, Q16 ]
hdri: [ HDRI, noHDRI ]
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: 'Azure CLI login with federated credential'
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Create msixbundle with Advanced Installer
if: github.event_name != 'pull_request'
uses: caphyon/[email protected]
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\Artifacts\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
permissions:
contents: write
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-Q8/ImageMagick.Q8.msixbundle
artifacts/Msix-Q16/ImageMagick.Q16.msixbundle
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: [ Q8, Q16 ]
hdri: [ HDRI, noHDRI ]
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}}