Skip to content

Commit 08840f4

Browse files
committed
ci: add install-deps script
1 parent d20d90f commit 08840f4

File tree

2 files changed

+75
-57
lines changed

2 files changed

+75
-57
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -178,63 +178,7 @@ jobs:
178178
env: |
179179
VCPKG_FORCE_SYSTEM_BINARIES: 1
180180
install: |
181-
set -x
182-
case "${{ matrix.distro }}" in
183-
fedora*)
184-
dnf update -q -y
185-
dnf install -y \
186-
bash \
187-
build-essential \
188-
curl \
189-
git \
190-
g++ \
191-
make \
192-
ninja-build \
193-
pkg-config \
194-
unzip \
195-
zip \
196-
python3 \
197-
tar \
198-
cmake \
199-
ninja-build \
200-
automake \
201-
autoconf \
202-
libtool \
203-
nodejs
204-
;;
205-
alpine*)
206-
apk update
207-
apk add --no-cache bash build-base curl git g++ make ninja-build pkgconfig unzip zip python3 tar cmake musl-dev automake autoconf libtool nodejs npm
208-
cp /usr/lib/ninja-build/bin/ninja /usr/bin/ninja
209-
;;
210-
*)
211-
# Default case (Ubuntu/Debian)
212-
apt-get update -q -y
213-
apt-get install --no-install-recommends -y \
214-
bash \
215-
build-essential \
216-
curl \
217-
git \
218-
g++ \
219-
make \
220-
ninja-build \
221-
pkg-config \
222-
unzip \
223-
zip \
224-
python3 \
225-
tar \
226-
cmake \
227-
ninja-build \
228-
automake \
229-
autoconf \
230-
libtool \
231-
nodejs \
232-
npm
233-
;;
234-
esac
235-
npm i -g pnpm
236-
npx -y setup-cpp --vcpkg "ee2d2a100103e0f3613c60655dcf15be7d5157b8"
237-
~/vcpkg/vcpkg install 'zeromq[draft,curve,sodium]'
181+
./script/install-deps.bash
238182
239183
run: |
240184
pnpm install && \

script/install-deps.bash

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#!/bin/bash
2+
3+
set -x
4+
5+
# Ubuntu/Debian
6+
apt=$(command -v apt-get || true)
7+
if [[ -n $apt ]]; then
8+
apt-get update -q -y
9+
apt-get install --no-install-recommends -y \
10+
bash \
11+
build-essential \
12+
curl \
13+
git \
14+
g++ \
15+
make \
16+
ninja-build \
17+
pkg-config \
18+
unzip \
19+
zip \
20+
python3 \
21+
tar \
22+
cmake \
23+
ninja-build \
24+
automake \
25+
autoconf \
26+
libtool \
27+
nodejs \
28+
npm
29+
fi
30+
31+
# Alpine Linux
32+
apk=$(command -v apk || true)
33+
if [[ -n $apk ]]; then
34+
apk update
35+
apk add --no-cache bash build-base curl git g++ make ninja-build pkgconfig unzip zip python3 tar cmake musl-dev automake autoconf libtool nodejs npm
36+
cp /usr/lib/ninja-build/bin/ninja /usr/bin/ninja
37+
fi
38+
39+
# Fedora/RHEL
40+
dnf=$(command -v dnf || true)
41+
if [[ -n $dnf ]]; then
42+
dnf update -q -y
43+
dnf install -y \
44+
bash \
45+
build-essential \
46+
curl \
47+
git \
48+
g++ \
49+
make \
50+
ninja-build \
51+
pkg-config \
52+
unzip \
53+
zip \
54+
python3 \
55+
tar \
56+
cmake \
57+
ninja-build \
58+
automake \
59+
autoconf \
60+
libtool \
61+
nodejs
62+
fi
63+
64+
# pnpm
65+
npm i -g pnpm
66+
67+
# vcpkg
68+
npx -y setup-cpp --vcpkg "ee2d2a100103e0f3613c60655dcf15be7d5157b8"
69+
70+
# zeromq
71+
export VCPKG_FORCE_SYSTEM_BINARIES=1
72+
cd ~/vcpkg || exit 1
73+
~/vcpkg/vcpkg install 'zeromq[draft,curve,sodium]' || (cd - || exit 1)
74+
cd - || exit 1

0 commit comments

Comments
 (0)