From 08840f43106b726785e382f71226c88beb1ea08b Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Thu, 2 Jan 2025 10:27:57 -0800 Subject: [PATCH] ci: add install-deps script --- .github/workflows/CI.yml | 58 +------------------------------ script/install-deps.bash | 74 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 57 deletions(-) create mode 100755 script/install-deps.bash diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d7b62ded..47c21f73 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -178,63 +178,7 @@ jobs: env: | VCPKG_FORCE_SYSTEM_BINARIES: 1 install: | - set -x - case "${{ matrix.distro }}" in - fedora*) - dnf update -q -y - dnf install -y \ - bash \ - build-essential \ - curl \ - git \ - g++ \ - make \ - ninja-build \ - pkg-config \ - unzip \ - zip \ - python3 \ - tar \ - cmake \ - ninja-build \ - automake \ - autoconf \ - libtool \ - nodejs - ;; - alpine*) - apk update - 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 - cp /usr/lib/ninja-build/bin/ninja /usr/bin/ninja - ;; - *) - # Default case (Ubuntu/Debian) - apt-get update -q -y - apt-get install --no-install-recommends -y \ - bash \ - build-essential \ - curl \ - git \ - g++ \ - make \ - ninja-build \ - pkg-config \ - unzip \ - zip \ - python3 \ - tar \ - cmake \ - ninja-build \ - automake \ - autoconf \ - libtool \ - nodejs \ - npm - ;; - esac - npm i -g pnpm - npx -y setup-cpp --vcpkg "ee2d2a100103e0f3613c60655dcf15be7d5157b8" - ~/vcpkg/vcpkg install 'zeromq[draft,curve,sodium]' + ./script/install-deps.bash run: | pnpm install && \ diff --git a/script/install-deps.bash b/script/install-deps.bash new file mode 100755 index 00000000..58ed60c5 --- /dev/null +++ b/script/install-deps.bash @@ -0,0 +1,74 @@ +#!/bin/bash + +set -x + +# Ubuntu/Debian +apt=$(command -v apt-get || true) +if [[ -n $apt ]]; then + apt-get update -q -y + apt-get install --no-install-recommends -y \ + bash \ + build-essential \ + curl \ + git \ + g++ \ + make \ + ninja-build \ + pkg-config \ + unzip \ + zip \ + python3 \ + tar \ + cmake \ + ninja-build \ + automake \ + autoconf \ + libtool \ + nodejs \ + npm +fi + +# Alpine Linux +apk=$(command -v apk || true) +if [[ -n $apk ]]; then + apk update + 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 + cp /usr/lib/ninja-build/bin/ninja /usr/bin/ninja +fi + +# Fedora/RHEL +dnf=$(command -v dnf || true) +if [[ -n $dnf ]]; then + dnf update -q -y + dnf install -y \ + bash \ + build-essential \ + curl \ + git \ + g++ \ + make \ + ninja-build \ + pkg-config \ + unzip \ + zip \ + python3 \ + tar \ + cmake \ + ninja-build \ + automake \ + autoconf \ + libtool \ + nodejs +fi + +# pnpm +npm i -g pnpm + +# vcpkg +npx -y setup-cpp --vcpkg "ee2d2a100103e0f3613c60655dcf15be7d5157b8" + +# zeromq +export VCPKG_FORCE_SYSTEM_BINARIES=1 +cd ~/vcpkg || exit 1 +~/vcpkg/vcpkg install 'zeromq[draft,curve,sodium]' || (cd - || exit 1) +cd - || exit 1