Skip to content

Commit 371fede

Browse files
committed
Install ImageMagick and oxipng in GitHub workflows
1 parent abf8c9c commit 371fede

3 files changed

Lines changed: 16 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424
steps:
2525
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2626

27+
- run: scripts/install_imagemagick_and_oxipng.sh
28+
2729
- name: Restore npm cache if possible
2830
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
2931
with:

.github/workflows/release.yaml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,7 @@ jobs:
3131
exit 1
3232
fi
3333
34-
- name: Install ImageMagick
35-
run: |
36-
sudo apt install --update -y imagemagick
37-
- name: Install oxipng
38-
env:
39-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40-
run: |
41-
cd "$(mktemp -d)"
42-
gh release download -R oxipng/oxipng -p 'oxipng-*.*.*-x86_64-unknown-linux-gnu.tar.gz'
43-
tar -xf oxipng-*.*.*-x86_64-unknown-linux-gnu.tar.gz --strip-components 1
44-
mkdir -p ~/.local/bin
45-
mv oxipng ~/.local/bin
34+
- run: scripts/install_imagemagick_and_oxipng.sh
4635

4736
- name: Restore npm cache if possible
4837
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
if ! command -v convert; then
4+
sudo apt install --update -y imagemagick
5+
fi
6+
7+
if ! command -v oxipng; then
8+
cd "$(mktemp -d)"
9+
gh release download -R oxipng/oxipng -p 'oxipng-*.*.*-x86_64-unknown-linux-gnu.tar.gz'
10+
tar -xf oxipng-*.*.*-x86_64-unknown-linux-gnu.tar.gz --strip-components 1
11+
mkdir -p ~/.local/bin
12+
mv oxipng ~/.local/bin
13+
fi

0 commit comments

Comments
 (0)