forked from microsoft/node-pty
-
Notifications
You must be signed in to change notification settings - Fork 16
130 lines (110 loc) · 3.94 KB
/
prebuild.yml
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: "Prebuild node-gyp and package for a GitHub Release"
run-name: Package against ${{ github.event.inputs.tag }}
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag'
required: true
jobs:
buildify:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
name: [
alpine-x86_64,
alpine-arm32v6,
alpine-arm64v8,
debian-x86_64,
debian-i386,
debian-arm32v6,
debian-arm64v8,
darwin-x86_64,
windows-x86_64,
]
include:
- name: alpine-x86_64
os: ubuntu-latest
BASE_IMAGE: library/node:16-alpine
DOCKERFILE: Dockerfile.alpine
QEMU_ARCH: x86_64
- name: alpine-arm32v6
os: ubuntu-latest
BASE_IMAGE: arm32v6/node:16-alpine
DOCKERFILE: Dockerfile.alpine
QEMU_ARCH: arm
- name: alpine-arm64v8
os: ubuntu-latest
BASE_IMAGE: arm64v8/node:16-alpine
DOCKERFILE: Dockerfile.alpine
QEMU_ARCH: aarch64
- name: debian-x86_64
os: ubuntu-latest
BASE_IMAGE: library/debian:11.7-slim
DOCKERFILE: Dockerfile.debian
QEMU_ARCH: x86_64
- name: debian-i386
os: ubuntu-latest
BASE_IMAGE: i386/debian:11.7-slim
DOCKERFILE: Dockerfile.debian
QEMU_ARCH: i386
- name: debian-arm32v6
os: ubuntu-latest
BASE_IMAGE: balenalib/raspberry-pi-debian:bullseye
DOCKERFILE: Dockerfile.debian
QEMU_ARCH: arm
- name: debian-arm64v8
os: ubuntu-latest
BASE_IMAGE: arm64v8/debian:11.7-slim
DOCKERFILE: Dockerfile.debian
QEMU_ARCH: aarch64
- name: darwin-x86_64
os: macOS-latest
- name: windows-x86_64
os: windows-2019
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Linux - Setup Dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get --yes --no-install-recommends install binfmt-support qemu-user-static
docker run --rm --privileged multiarch/qemu-user-static:register --reset
- name: Linux - Build Docker Image
if: runner.os == 'Linux'
run: |
docker build -f .prebuild/${{ matrix.DOCKERFILE }} --build-arg BASE_IMAGE=${{ matrix.BASE_IMAGE }} --build-arg QEMU_ARCH=${{ matrix.QEMU_ARCH }} -t multiarch-build .
- name: Linux - Prebuild Binaries
if: runner.os == 'Linux'
run: |
docker run --rm -v $(pwd):/node-pty multiarch-build
- name: macOS - Prebuild Binaries
if: runner.os == 'macOS'
run: |
npm install --ignore-scripts
env JOBS=max node .prebuild/buildify.js
- name: Windows - Prebuild Binaries
if: runner.os == 'Windows'
shell: bash
run: |
npm install --ignore-scripts
env JOBS=max node_modules/.bin/prebuildify -t 10.0.0 -t 11.0.0 -t 12.0.0 -t 13.0.0 -t 14.0.0 -t 15.0.0 -t 16.0.0 -t 17.0.1 --include-regex "\.(node|exe|dll|pdb)" --arch ia32
env JOBS=max node_modules/.bin/prebuildify -t 10.0.0 -t 11.0.0 -t 12.0.0 -t 13.0.0 -t 14.0.0 -t 15.0.0 -t 16.0.0 -t 17.0.1 -t 18.0.0 -t 20.0.0 --include-regex "\.(node|exe|dll|pdb)"
- name: Check prebuilds exist
shell: bash
run: |
fileCount=$(ls prebuilds/*/*node | wc -l)
echo "Prebuild count ${fileCount}"
if [ "$fileCount" -eq 0 ]; then exit 1; fi
- name: Package for GitHub Release
shell: bash
run: for i in `ls prebuilds/`; do tar cvzf prebuilds-$i.tar.gz prebuilds/$i; done
- uses: AButler/[email protected]
with:
files: 'prebuilds-*tar.gz'
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: ${{ github.event.inputs.tag }}