Skip to content

Commit

Permalink
chore: fix tool dep installation for linux & macos
Browse files Browse the repository at this point in the history
  • Loading branch information
cmars committed Feb 25, 2024
1 parent 821e86e commit 5a7b791
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 8 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,9 @@ jobs:
- name: Install dependencies
run: |
${{ matrix.packages_install }}
- name: Install capnproto
- name: Install capnproto & protobuf needed by veilid & distrans
run: |
cd /tmp
curl -O https://capnproto.org/capnproto-c++-1.0.2.tar.gz
tar zxf capnproto-c++-1.0.2.tar.gz
cd capnproto-c++-1.0.2
./configure
make -j6 check
sudo make install
./scripts/install_tools.sh
- name: Build artifacts
run: |
# Actually do builds and make zips and whatnot
Expand Down
44 changes: 44 additions & 0 deletions scripts/install_tools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env bash

set -eux

# TODO: support windows somehow

CAPNP_VERSION="1.0.2"
PROTOC_VERSION="24.3" # Keep in sync with veilid-core/build.rs

build_dir=$(mktemp -d)
trap "rm -rf $build_dir" EXIT

cd $build_dir
mkdir -p capnp-build protoc-install

# Install capnp
pushd capnp-build
curl -O https://capnproto.org/capnproto-c++-${CAPNP_VERSION}.tar.gz
tar zxf capnproto-c++-${CAPNP_VERSION}.tar.gz
cd capnproto-c++-1.0.2
./configure
sudo make -j6 install
popd

# Install protoc
pushd protoc-install
UNAME_M=$(uname -m)
if [[ "$UNAME_M" == "x86_64" ]]; then
PROTOC_ARCH=x86_64
elif [[ "$UNAME_M" == "aarch64" ]]; then
PROTOC_ARCH=aarch_64
else
echo Unsupported build architecture
exit 1
fi
PROTOC_OS="linux"
if [ "$(uname -o)" == "Darwin" ]; then
PROTOC_OS="osx"
fi

curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-$PROTOC_OS-$PROTOC_ARCH.zip
unzip protoc-$PROTOC_VERSION-$PROTOC_OS-$PROTOC_ARCH.zip
sudo cp -r bin include /usr/local/
popd

0 comments on commit 5a7b791

Please sign in to comment.