Skip to content

Commit

Permalink
support ubuntu noble (#144)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
vintagesucks and github-actions[bot] authored May 20, 2024
1 parent e6a0bc0 commit 7b3cf19
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 89 deletions.
55 changes: 38 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,27 @@ permissions: write-all

jobs:
build:
name: "Build"
runs-on: ubuntu-22.04
strategy:
matrix:
os:
- ubuntu-22.04
- ubuntu-24.04

include:
- os: ubuntu-22.04
ubuntu: jammy
- os: ubuntu-24.04
ubuntu: noble

name: ${{ matrix.os }}

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4.1.5
- uses: actions/checkout@v4.1.6

- name: Build packages
run: DOCKER_BUILDKIT=1 docker build --tag imagemagick-deb --output binaries .
run: DOCKER_BUILDKIT=1 docker build --build-arg UBUNTU_VERSION=${{ matrix.ubuntu }} --output binaries .

- name: List packages
run: ls -lah binaries
Expand All @@ -38,30 +52,37 @@ jobs:
- name: magick -list format
run: magick -list format

- name: Attest build provenance
uses: actions/attest-build-provenance@v1.1.2
if: contains(github.ref, 'tags')
with:
subject-path: 'binaries/*'

- name: Archive binary artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4.3.3
with:
name: binaries
name: binaries-${{ matrix.ubuntu }}
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: svenstaro/upload-release-action@2.9.0
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: binaries/*
tag: ${{ github.ref }}
overwrite: true
file_glob: true

- uses: actions/checkout@v4.1.5
if: github.event_name == 'pull_request'
- uses: actions/checkout@v4.1.6
if: github.event_name == 'pull_request' && matrix.ubuntu == 'noble'
with:
ref: ${{ github.event.pull_request.head.ref }}
persist-credentials: false
fetch-depth: 0

- name: Update README
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' && matrix.ubuntu == 'noble'
run: |
sed -i '/#### Example Output/q' ./README.md
echo '```sh' >> README.md
Expand All @@ -73,7 +94,7 @@ jobs:
echo '```' >> README.md
- name: Commit README update
if: github.event_name == 'pull_request'
if: github.event_name == 'pull_request' && matrix.ubuntu == 'noble'
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
Expand All @@ -82,7 +103,7 @@ jobs:
git diff-index --quiet HEAD || git commit -m "Update README [skip ci]" && echo "push_readme=true" >> $GITHUB_ENV
- name: Push README update to Pull Request
if: env.push_readme
if: env.push_readme && matrix.ubuntu == 'noble'
uses: ad-m/github-push-action@v0.8.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-imagemagick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.5
- uses: actions/checkout@v4.1.6
- run: wget -O version.json "https://api.github.com/repos/ImageMagick/ImageMagick/releases/latest"
- name: Get latest version
id: version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-libde265.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.5
- uses: actions/checkout@v4.1.6
- run: wget -O version.json "https://api.github.com/repos/strukturag/libde265/releases/latest"
- name: Get latest version
id: version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-libheif.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.5
- uses: actions/checkout@v4.1.6
- run: wget -O version.json "https://api.github.com/repos/strukturag/libheif/releases/latest"
- name: Get latest version
id: version
Expand Down
19 changes: 12 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Build Packages
FROM --platform=linux/amd64 ubuntu:jammy as builder
ARG UBUNTU_VERSION
FROM --platform=linux/amd64 ubuntu:${UBUNTU_VERSION} as builder
SHELL ["/bin/bash", "-c"]
ENV DEBIAN_FRONTEND=noninteractive

Expand Down Expand Up @@ -28,7 +29,7 @@ RUN apt satisfy -y "$LIBHEIF_DEPENDENCIES"

# Install ImageMagick dependencies
ENV IMAGEMAGICK_DEPENDENCIES='\
gsfonts,\
fonts-urw-base35,\
libbz2-dev,\
libfontconfig1-dev (>= 2.1.0),\
libfreetype-dev (>= 2.8.0),\
Expand Down Expand Up @@ -58,7 +59,9 @@ WORKDIR libde265
RUN ./autogen.sh
RUN ./configure
RUN make -j$(nproc)
RUN checkinstall --pkgversion="$LIBDE265_VERSION"
RUN checkinstall \
--pkgversion="$LIBDE265_VERSION" \
--fstrans=no
RUN mv libde265_*.deb ../binaries/
RUN pkg-config --exists --print-errors "libde265 = $LIBDE265_VERSION"
WORKDIR /
Expand All @@ -73,7 +76,8 @@ RUN make -j$(nproc)
RUN checkinstall \
--pkgname="libheif" \
--pkgversion="$LIBHEIF_VERSION" \
--requires="'$LIBHEIF_DEPENDENCIES, libde265 (>= $LIBDE265_VERSION)'"
--requires="'$LIBHEIF_DEPENDENCIES, libde265 (>= $LIBDE265_VERSION)'" \
--fstrans=no
RUN mv libheif_*.deb ../../binaries/
RUN pkg-config --exists --print-errors "libheif = $LIBHEIF_VERSION"
WORKDIR /
Expand Down Expand Up @@ -113,7 +117,8 @@ RUN make -j$(nproc)
RUN checkinstall \
--pkgversion=$IMAGEMAGICK_EPOCH$(echo "$IMAGEMAGICK_VERSION" | cut -d- -f1) \
--pkgrelease=$(echo "$IMAGEMAGICK_VERSION" | cut -d- -f2) \
--requires="'$IMAGEMAGICK_DEPENDENCIES, libde265 (>= $LIBDE265_VERSION), libheif (>= $LIBHEIF_VERSION)'"
--requires="'$IMAGEMAGICK_DEPENDENCIES, libde265 (>= $LIBDE265_VERSION), libheif (>= $LIBHEIF_VERSION)'" \
--fstrans=no
RUN ldconfig
RUN mv imagemagick_*.deb ../binaries/
RUN [[ $(dpkg-query -W -f='${Version}' imagemagick) == $IMAGEMAGICK_EPOCH$IMAGEMAGICK_VERSION ]]
Expand All @@ -126,7 +131,7 @@ RUN CODENAME=$( . /etc/os-release ; echo $UBUNTU_CODENAME) && \
WORKDIR /

# Test package install
FROM --platform=linux/amd64 ubuntu:jammy as tester
FROM --platform=linux/amd64 ubuntu:${UBUNTU_VERSION} as tester
COPY --from=builder binaries binaries
SHELL ["/bin/bash", "-c"]
ENV DEBIAN_FRONTEND=noninteractive
Expand Down Expand Up @@ -188,7 +193,7 @@ RUN [[ $(magick -list format) =~ "DNG DNG r--" ]]
RUN [[ $(magick -list format) =~ "AVIF HEIC rw+" ]]

# Check font support
RUN [[ $(magick -list font) =~ "Helvetica" ]]
RUN [[ $(magick -list font) =~ "Nimbus Sans" ]]

# Upgrade imagick php extension
RUN printf "\n" | MAKEFLAGS="-j $(nproc)" pecl upgrade --force ./imagick.tgz
Expand Down
Loading

0 comments on commit 7b3cf19

Please sign in to comment.