Skip to content

Commit

Permalink
setup arm build
Browse files Browse the repository at this point in the history
  • Loading branch information
n1ru4l committed Jul 21, 2020
1 parent 6e250c6 commit 9290cc7
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/build-arm-bindings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build ARM bindings

on:
push:

jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
nodeVersion: [11, 12, 13, 14]
platform: ["linux", "alpine"]
arch: [linux/arm/v7, linux/arm64]
include:
- platform: "linux"
variant: "stretch"
- platform: "alpine"
variant: "alpine"

- arch: linux/arm/v7
archShort: armv7
- arch: linux/arm64
archShort: arm64

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Docker Buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
buildx-version: latest
qemu-version: latest
- name: Build Node ${{ matrix.nodeVersion }} for ${{ matrix.platform }}
run: |
docker buildx build \
--file BinaryBuilder.Dockerfile \
--load \
--tag sqlite-builder \
--platform ${{ matrix.arch }} \
--no-cache \
--build-arg NODE_VERSION=${{ matrix.nodeVersion }} \
--build-arg VARIANT=${{ matrix.variant }} \
--build-arg AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} \
--build-arg AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} \
.
CONTAINER_ID=$(docker create -it sqlite-builder)
docker cp $CONTAINER_ID:/usr/src/build/build/ ./build
docker kill $CONTAINER_ID
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: node${{ matrix.nodeVersion }}-${{ matrix.platform }}-${{ matrix.archShort }}
path: "./build/"
19 changes: 19 additions & 0 deletions BinaryBuilder.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
ARG NODE_VERSION=12
ARG VARIANT=stretch
FROM node:$NODE_VERSION-$VARIANT

ARG VARIANT
ARG AWS_ACCESS_KEY_ID=SKIP
ARG AWS_SECRET_ACCESS_KEY=SKIP

RUN if [ "$VARIANT" = "alpine" ] ; then apk add make g++ python ; fi

WORKDIR /usr/src/build

COPY . .
RUN npm install --ignore-scripts
RUN npx node-pre-gyp install --build-from-source
RUN npx node-pre-gyp package
RUN if [ "$AWS_ACCESS_KEY_ID" = "SKIP" ] || [ "$AWS_SECRET_ACCESS_KEY" = "SKIP" ] ; then echo "SKIP S3 PUBLISH" ; else npx node-pre-gyp publish ; fi

CMD ["sh"]

0 comments on commit 9290cc7

Please sign in to comment.