Skip to content

Commit

Permalink
ci: add support for arm64 Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Jan 1, 2025
1 parent 0afa859 commit 826cfd8
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 4 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,24 @@ jobs:
node_arch: arm64
cpp_arch: amd64_arm64

# Alpine
# Musl Alpine
- os: ubuntu-22.04
dockerfile: docker/alpine.dockerfile
node_arch: x64
cpp_arch: x64

# Debian Arm
- os: macos-14
node_arch: arm64
cpp_arch: amd64_arm64
dockerfile: docker/alpine.dockerfile

# Musl Alpine Arm
- os: macos-14
node_arch: arm64
cpp_arch: amd64_arm64
dockerfile: docker/debian.dockerfile

env:
npm_config_arch: ${{ matrix.node_arch }}
npm_config_target_arch: ${{ matrix.node_arch }}
Expand Down Expand Up @@ -137,7 +149,8 @@ jobs:
run: |
docker build -t zeromq -f ${{ matrix.dockerfile }} .
docker create --name zeromq-temp zeromq
docker cp zeromq-temp:/app/build ./build
mkdir -p ./build
docker cp zeromq-temp:/app/build ./
docker rm -f zeromq-temp
- name: Upload build
Expand Down
16 changes: 14 additions & 2 deletions docker/alpine.dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
FROM node:18-alpine
FROM node:18-alpine AS builder

WORKDIR /app
COPY ./ ./
ENV VCPKG_FORCE_SYSTEM_BINARIES=1
RUN apk add --no-cache \
RUN \
# system dependencies
apk add --no-cache \
bash \
build-base \
curl \
Expand All @@ -23,6 +25,16 @@ RUN apk add --no-cache \
autoconf \
libtool && \
cp /usr/lib/ninja-build/bin/ninja /usr/bin/ninja && \
# build
npm i -g pnpm && \
pnpm install && \
pnpm run build

FROM node:18-alpine
WORKDIR /app

COPY ./ ./
COPY --from=builder /app/build ./build
COPY --from=builder /app/node_modules ./node_modules


37 changes: 37 additions & 0 deletions docker/debian.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM node:18 AS builder

WORKDIR /app
COPY ./ ./
ENV VCPKG_FORCE_SYSTEM_BINARIES=1
RUN \
# system dependencies
apt-get update -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 && \
# build
npm i -g pnpm && \
pnpm install && \
pnpm run build

FROM node:18
WORKDIR /app

COPY ./ ./
COPY --from=builder /app/build ./build
COPY --from=builder /app/node_modules ./node_modules

0 comments on commit 826cfd8

Please sign in to comment.