-
-
Notifications
You must be signed in to change notification settings - Fork 817
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
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 and Push | ||
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 | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: node${{ matrix.nodeVersion }}-${{ matrix.platform }}-${{ matrix.archShort }} | ||
path: "./build/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |