Skip to content

Commit 8932555

Browse files
committed
setup arm build
1 parent 6e250c6 commit 8932555

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed

Diff for: .github/workflows/build-arm-bindings.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build ARM bindings
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
build:
8+
name: Build
9+
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
nodeVersion: [11, 12, 13, 14]
14+
platform: ["linux", "alpine"]
15+
arch: [linux/arm/v7, linux/arm64]
16+
include:
17+
- platform: "linux"
18+
variant: "stretch"
19+
- platform: "alpine"
20+
variant: "alpine"
21+
22+
- arch: linux/arm/v7
23+
archShort: armv7
24+
- arch: linux/arm64
25+
archShort: arm64
26+
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v2
30+
- name: Setup Docker Buildx
31+
uses: crazy-max/ghaction-docker-buildx@v1
32+
with:
33+
buildx-version: latest
34+
qemu-version: latest
35+
- name: Build and Push
36+
run: |
37+
docker buildx build \
38+
--file BinaryBuilder.Dockerfile \
39+
--load \
40+
--tag sqlite-builder \
41+
--platform ${{ matrix.arch }} \
42+
--no-cache \
43+
--build-arg NODE_VERSION=${{ matrix.nodeVersion }} \
44+
--build-arg VARIANT=${{ matrix.variant }} \
45+
--build-arg AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }} \
46+
--build-arg AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} \
47+
.
48+
CONTAINER_ID=$(docker create -it sqlite-builder)
49+
docker cp $CONTAINER_ID:/usr/src/build/build/ ./build
50+
51+
- name: Upload artifacts
52+
uses: actions/upload-artifact@v2
53+
with:
54+
name: node${{ matrix.nodeVersion }}-${{ matrix.platform }}-${{ matrix.archShort }}
55+
path: "./build/"

Diff for: BinaryBuilder.Dockerfile

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
ARG NODE_VERSION=12
2+
ARG VARIANT=stretch
3+
FROM node:$NODE_VERSION-$VARIANT
4+
5+
ARG VARIANT
6+
ARG AWS_ACCESS_KEY_ID=SKIP
7+
ARG AWS_SECRET_ACCESS_KEY=SKIP
8+
9+
RUN if [ "$VARIANT" = "alpine" ] ; then apk add make g++ python ; fi
10+
11+
WORKDIR /usr/src/build
12+
13+
COPY . .
14+
RUN npm install --ignore-scripts
15+
RUN npx node-pre-gyp install --build-from-source
16+
RUN npx node-pre-gyp package
17+
RUN if [ "$AWS_ACCESS_KEY_ID" = "SKIP" ] || [ "$AWS_SECRET_ACCESS_KEY" = "SKIP" ] ; then echo "SKIP S3 PUBLISH" ; else npx node-pre-gyp publish ; fi
18+
19+
CMD ["sh"]

0 commit comments

Comments
 (0)