forked from louislam/node-sqlite3
-
Notifications
You must be signed in to change notification settings - Fork 5
83 lines (75 loc) · 2.53 KB
/
Copy pathdebian.yaml
File metadata and controls
83 lines (75 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: debian
on:
workflow_dispatch:
env:
FORCE_COLOR: 1
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build-qemu:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node:
- 16
target:
- linux/arm64
- linux/amd64
- linux/ppc64le
- linux/s390x
- linux/arm/v7
variant:
- slim
name: ${{ matrix.variant }} (node=${{ matrix.node }}, target=${{ matrix.target }})
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Add env vars
shell: bash
run: |
echo "V=1" >> $GITHUB_ENV
if [[ "${{ matrix.target }}" = "linux/arm/v7" ]]; then
echo "TARGET=arm" >> $GITHUB_ENV
elif [ "${{ matrix.target }}" = "linux/arm64" ]; then
echo "TARGET=arm64" >> $GITHUB_ENV
elif [ "${{ matrix.target }}" = "linux/amd64" ]; then
echo "TARGET=x64" >> $GITHUB_ENV
elif [ "${{ matrix.target }}" = "linux/ppc64le" ]; then
echo "TARGET=ppc64" >> $GITHUB_ENV
elif [ "${{ matrix.target }}" = "linux/s390x" ]; then
echo "TARGET=s390x" >> $GITHUB_ENV
elif [ "${{ matrix.target }}" = "linux/386" ]; then
echo "TARGET=ia32" >> $GITHUB_ENV
fi
cat $GITHUB_ENV
- name: Build binaries and test
run: |
docker buildx build \
--file ./tools/BinaryBuilder-debian.Dockerfile \
--load \
--tag sqlite-builder \
--platform ${{ matrix.target }} \
--no-cache \
--build-arg VARIANT=${{ matrix.variant }} \
--build-arg TARGET=${{ env.TARGET }} \
--build-arg NODE_VERSION=${{ matrix.node }} \
.
CONTAINER_ID=$(docker create -it sqlite-builder)
docker cp $CONTAINER_ID:/usr/src/build/build/ ./build
- name: Upload binaries to commit artifacts
uses: actions/upload-artifact@v3
if: matrix.node == 16
with:
name: prebuilt-binaries
path: build/stage/*/*
retention-days: 7
- name: Upload binaries to GitHub Release
run: yarn install --ignore-scripts && yarn node-pre-gyp-github publish --release
if: matrix.node == 16
env:
NODE_PRE_GYP_GITHUB_TOKEN: ${{ secrets.API_TOKEN }}