Skip to content

Package against v0.11.8-beta.0 #49

Package against v0.11.8-beta.0

Package against v0.11.8-beta.0 #49

Workflow file for this run

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:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
name: [
darwin-x64,
linux-arm,
linux-arm64,
linux-ia32,
linux-x64,
linuxmusl-arm,
linuxmusl-arm64,
linuxmusl-x64,
win32-ia32,
win32-x64
]
include:
- name: linuxmusl-x64
os: ubuntu-latest
BASE_IMAGE: library/node:16-alpine
DOCKERFILE: Dockerfile.alpine
QEMU_ARCH: x86_64
COUNT: 25
NPMCOUNT: 11
- name: linuxmusl-arm
os: ubuntu-latest
BASE_IMAGE: arm32v6/node:16-alpine
DOCKERFILE: Dockerfile.alpine
QEMU_ARCH: arm
COUNT: 25
NPMCOUNT: 11
- name: linuxmusl-arm64
os: ubuntu-latest
BASE_IMAGE: arm64v8/node:16-alpine
DOCKERFILE: Dockerfile.alpine
QEMU_ARCH: aarch64
COUNT: 25
NPMCOUNT: 11
- name: linux-x64
os: ubuntu-latest
BASE_IMAGE: library/debian:11.7-slim
DOCKERFILE: Dockerfile.debian
QEMU_ARCH: x86_64
COUNT: 25
NPMCOUNT: 11
- name: linux-ia32
os: ubuntu-latest
BASE_IMAGE: i386/debian:11.7-slim
DOCKERFILE: Dockerfile.debian
QEMU_ARCH: i386
COUNT: 23
NPMCOUNT: 11
- name: linux-arm
os: ubuntu-latest
BASE_IMAGE: balenalib/raspberry-pi-debian:bullseye
DOCKERFILE: Dockerfile.debian
QEMU_ARCH: arm
COUNT: 25
NPMCOUNT: 11
- name: linux-arm64
os: ubuntu-latest
BASE_IMAGE: arm64v8/debian:11.7-slim
DOCKERFILE: Dockerfile.debian
QEMU_ARCH: aarch64
COUNT: 25
NPMCOUNT: 11
- name: darwin-x64
os: macOS-latest
COUNT: 25
NPMCOUNT: 11
- name: win32-ia32
os: windows-2019
arch: ia32
COUNT: 21
NPMCOUNT: 0
- name: win32-x64
os: windows-2019
arch: x64
COUNT: 25
NPMCOUNT: 0
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 ci --ignore-scripts
env JOBS=max node .prebuild/build.js
# buildify doesn't work on Mac due to missing spawn_helper
# env JOBS=max node .prebuild/buildify.js
- name: Windows ia32 - Prebuild Binaries
if: ${{ (runner.os == 'Windows') && (matrix.arch == 'ia32') }}
shell: bash
run: |
npm ci --ignore-scripts
env JOBS=max node_modules/.bin/prebuild -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 ${{ matrix.arch }}
env JOBS=max node_modules/.bin/prebuild -t 5.0.0 -t 6.0.0 -t 7.0.0 -t 8.0.0 -t 9.0.0 -t 10.0.0 -t 11.0.0 -t 12.0.0 -t 13.0.0 -t 14.0.2 -t 15.0.0 -t 16.0.0 -t 17.0.0 --include-regex "\.(node|exe|dll|pdb)" -r electron -a ${{ matrix.arch }}
- name: Windows x64 - Prebuild Binaries
if: ${{ (runner.os == 'Windows') && (matrix.arch == 'x64') }}
shell: bash
run: |
npm ci --ignore-scripts
env JOBS=max node_modules/.bin/prebuild -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 -t 21.0.0 --include-regex "\.(node|exe|dll|pdb)" --arch ${{ matrix.arch }}
env JOBS=max node_modules/.bin/prebuild -t 5.0.0 -t 6.0.0 -t 7.0.0 -t 8.0.0 -t 9.0.0 -t 10.0.0 -t 11.0.0 -t 12.0.0 -t 13.0.0 -t 14.0.2 -t 15.0.0 -t 16.0.0 -t 17.0.0 -t 18.0.0 --include-regex "\.(node|exe|dll|pdb)" -r electron --arch ${{ matrix.arch }}
- name: Check Release prebuilds exist
shell: bash
run: |
fileCount=$(ls prebuilds/*/node-pty*tar.gz | wc -l)
echo "Release Prebuild count ${fileCount}"
echo "::notice::Release Prebuild count ${fileCount}, expected ${{ matrix.COUNT }}"
if [ "$fileCount" -eq 0 ]; then exit 1; fi
if [ "$fileCount" -ne ${{ matrix.COUNT }} ]; then exit 1; fi
- uses: AButler/[email protected]
name: Upload Release Artifacts to ${{ github.event.inputs.tag }}
with:
files: 'prebuilds/*/node-pty*tar.gz'
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: ${{ github.event.inputs.tag }}
- name: "Check file existence"
id: check_files
uses: andstor/file-existence-action@v2
with:
files: "prebuilds/*/node*node"
- name: Check NPM prebuilds exist
if: steps.check_files.outputs.files_exists == 'true'
shell: bash
run: |
fileCount=$(ls prebuilds/*/node*node | wc -l)
echo "NPM Prebuild count ${fileCount}"
echo "::notice::NPM Prebuild count ${fileCount}, expected ${{ matrix.NPMCOUNT }}"
if [ "$fileCount" -eq 0 ]; then exit 1; fi
if [ "$fileCount" -ne ${{ matrix.NPMCOUNT }} ]; then exit 1; fi
- name: Pack NPM prebuilds
if: steps.check_files.outputs.files_exists == 'true'
shell: bash
run: |
tar -cvzf prebuilds.${{ matrix.NAME }}.tar.gz prebuilds/*/node*node
- uses: AButler/[email protected]
name: Upload NPM prebuilds to ${{ github.event.inputs.tag }}
if: steps.check_files.outputs.files_exists == 'true'
with:
files: 'prebuilds.*.tar.gz'
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: ${{ github.event.inputs.tag }}