Skip to content

Build @cryptlex/lexactivator package #211

Build @cryptlex/lexactivator package

Build @cryptlex/lexactivator package #211

Workflow file for this run

name: Build @cryptlex/lexactivator package
on:
workflow_dispatch:
jobs:
# Link LexActivator static libs to Node
build-addons:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-13, windows-2019]
steps:
- uses: actions/checkout@v2
- run: git pull origin master --ff-only
- uses: actions/setup-node@v1
with:
node-version: 10
# - name: Install Windows 2015 build tools
# if: matrix.os == 'windows-2019'
# run: npm i --global windows-build-tools --vs2015
- name: Build for Windows
if: matrix.os == 'windows-2019'
shell: powershell
run: |
npm i -g node-gyp@8
.\scripts\build-windows.ps1
- name: Build for macOS
if: matrix.os == 'macos-13'
run: |
npm i -g node-gyp@8
./scripts/build-macos.sh
- name: Build for Linux
if: matrix.os == 'ubuntu-latest'
run: |
docker run -t -v $PWD:$PWD -w $PWD cryptlex/gcc-4.9:1 ./scripts/build-linux.sh
docker run -t -v $PWD:$PWD -w $PWD cryptlex/gcc-4.9-arm:1 ./scripts/build-linux-arm.sh
docker run -t -v $PWD:$PWD -w $PWD cryptlex/alpine-builder:2 ./scripts/build-linux-musl.sh
- name: 'Upload artifacts'
uses: actions/upload-artifact@v2
with:
name: artifacts
path: |
./lib/bindings/linux/**/**/*.node
./lib/bindings/macos/**/*.node
./lib/bindings/windows/**/*.node
./lib/bindings/windows/**/*.dll
retention-days: 1
# Publish to NPM
publish-npm:
needs: build-addons
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: git pull origin master --ff-only
- name: 'Download artifacts'
uses: actions/download-artifact@v2
with:
path: ./lib/bindings
name: artifacts
- name: 'Build library'
run: |
npm ci
npm run build
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}