Skip to content

new-build

new-build #13

name: new-build
on: workflow_dispatch
# push:
# tags: ['*']
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
HUSKY: 0
permissions:
contents: read
jobs:
build-linux:
# strategy:
# matrix:
# image:
# - linux-arm64
# - centos7
# - alpine
name: Build linux versions
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up node
uses: actions/setup-node@v4
with:
node-version: 22.5.1
# - name: Update npm
# run: npm install -g npm@10
# new versions of python don't include distutils. setuptools provides it.
# - name: Install setuptools
# run: pip install setuptools
- name: Install dependencies
run: npm ci --ignore-scripts
- name: whoami
run: id
- name: Make prebuildify available to npx
# this might be a bit of a hack. i could install prebuildify without
# --ignore-scripts, but that seems like a bad idea if ignoring scripts
# is important.
run: mkdir -p node_modules/.bin && ln -sr node_modules/prebuildify/bin.js node_modules/.bin/prebuildify
# build each image inline so the matrix doesn't checkout, install, install each time.
- name: Build alpine
run: docker run --rm -v ${{ github.workspace }}:/repo -w /repo -u $(id -u) ghcr.io/bmacnaughton/alpine
- name: Build centos7
run: docker run --rm -v ${{ github.workspace }}:/repo -w /repo -u $(id -u) ghcr.io/bmacnaughton/centos7
- name: Build linux-arm64
run: docker run --rm -v ${{ github.workspace }}:/repo -w /repo -u $(id -u) ghcr.io/bmacnaughton/linux-arm64
# now upload what was built
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: prebuilds-linux
path: prebuilds/
build-macos-windows:
strategy:
matrix:
include:
- os: macos-latest
build-group: darwin
- os: windows-latest
build-group: win32
name: Build ${{ matrix.build-group }}
runs-on: ${{ matrix.os }}
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up node
uses: actions/setup-node@v4
with:
node-version: 22.5.1
# - name: Update npm
# run: npm install -g npm@10
- name: Install dependencies
run: npm ci --ignore-scripts
# new versions of python don't include distutils. setuptools provides it.
- name: Install setuptools
run: pip install setuptools
- name: Build
run: npm run build:${{ matrix.build-group }}
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: prebuilds-${{ matrix.build-group }}
path: prebuilds/
# release:
# needs: [build-linux, build-macos-windows]
# name: Release to npm
# runs-on: ubuntu-latest
# timeout-minutes: 5
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# - name: Set up node
# uses: actions/setup-node@v4
# with:
# node-version: 22
# registry-url: https://registry.npmjs.org
# - name: Update npm
# run: npm install -g npm@10
# - name: Install
# run: npm ci --ignore-scripts
# - name: Download artifacts
# uses: actions/download-artifact@v4
# with:
# pattern: prebuilds-*
# path: prebuilds/
# merge-multiple: true
# - name: Publish to npm
# run: npm publish
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}