Skip to content

Migrate to GitHub actions, platform-specific packages, and add arm prebuilds #42

Migrate to GitHub actions, platform-specific packages, and add arm prebuilds

Migrate to GitHub actions, platform-specific packages, and add arm prebuilds #42

Workflow file for this run

name: release
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
arch: x64
- os: windows-latest
arch: arm64
- os: macos-latest
arch: x64
- os: macos-latest
arch: arm64
- os: ubuntu-latest
arch: x64
libc: glibc
image: ghcr.io/prebuild/centos7-devtoolset7:2.1.1
- os: ubuntu-latest
arch: x64
libc: musl
image: ghcr.io/prebuild/alpine:2.1.1
- os: ubuntu-latest
arch: arm64
libc: glibc
image: ghcr.io/prebuild/linux-arm64-lts:2.1.1
- os: ubuntu-latest
arch: arm64
libc: musl
image: ghcr.io/prebuild/linux-arm64-musl:2.1.1
- os: ubuntu-latest
arch: arm
libc: glibc
image: ghcr.io/prebuild/linux-armv7:2.1.1
- os: ubuntu-latest
arch: arm64
image: ghcr.io/prebuild/android-arm64:2.1.1
runs-on: ${{matrix.os}}
container:
image: ${{matrix.image}}
options: -u root
steps:
- uses: actions/checkout@v3
- run: corepack enable
- uses: actions/setup-node@v3
with:
cache: yarn
node-version: 16
- run: yarn --frozen-lockfile --ignore-scripts
- run: yarn prebuild --arch ${{ matrix.arch }}
env:
PREBUILD_LIBC: ${{ matrix.libc }}
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: prebuilds
path: prebuilds
release:
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: yarn
node-version: 16
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Build npm packages
run: node scripts/build-npm.js
- name: Publish to npm
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > ~/.npmrc
for pkg in npm/*; do
echo "Publishing $pkg..."
cd $pkg;
npm publish;
cd ../..;
done
echo "Publishing @parcel/watcher..."
npm publish