Skip to content

Commit

Permalink
scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
kmamal committed Jan 19, 2025
1 parent 8480e9b commit eabe7d2
Show file tree
Hide file tree
Showing 21 changed files with 2,181 additions and 10,572 deletions.
33 changes: 0 additions & 33 deletions .github/workflows/ci.yml

This file was deleted.

76 changes: 25 additions & 51 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,65 +1,39 @@
name: Prebuild, Create Release, Publish
name: Build and upload

on:
push:
tags:
- 'v*'
on: workflow_dispatch

permissions:
contents: write

jobs:
build:
name: ${{ matrix.platform.name }} Node.js v${{ matrix.node }}

strategy:
fail-fast: false
matrix:
node-version: [22.x]
os: [ubuntu-latest, windows-latest, macos-latest]
target: ["18.0.0", "20.0.0", "22.0.0"]
runs-on: ${{ matrix.os }}
permissions:
id-token: write
contents: write
attestations: write
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- if: runner.os == 'Linux'
run: sudo apt-get install -y build-essential libgl1-mesa-dri libglapi-mesa
libglew-dev libglu1-mesa-dev libosmesa6
libxi-dev mesa-utils pkg-config
- run: npm ci --ignore-scripts
- name: Prebuild and Publish
shell: bash
run: node ./node_modules/prebuild/bin.js -t ${{ matrix.target }} --strip --include-regex "\.(node|dll)$" -u ${{ secrets.GITHUB_TOKEN }} --verbose
- name: Prebuild and Publish (musl)
if: runner.os == 'Linux'
shell: bash
run: node ./node_modules/prebuild/bin.js --libc=musl -t ${{ matrix.target }} --strip -u ${{ secrets.GITHUB_TOKEN }} --verbose
- name: Attest
uses: actions/attest-build-provenance@v1
with:
subject-path: 'prebuilds/*.tar.gz'
platform:
- { name: 'Linux (x64)' ,os: ubuntu-24.04 }
- { name: 'Windows (x64)' ,os: windows-2022 }
- { name: 'Mac (x64)' ,os: macos-13 }
- { name: 'Mac (arm64)' ,os: macos-13 ,arch: arm64 }
node: [ 16, 18, 19, 20, 22, 24 ]

runs-on: ${{ matrix.platform.os }}

publish:
name: Publish to NPM
needs:
- build
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
with:
submodules: true

- uses: actions/setup-node@v4
with:
node-version: '22.x'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
- run: npm ci --ignore-scripts
- run: npm publish --provenance --access public
node-version: ${{ matrix.node }}

- if: ${{ startsWith(matrix.platform.os, 'ubuntu-') }}
run: ./scripts/install-deps-ubuntu.sh

- run: npm run release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROSS_COMPILE_ARCH: ${{ matrix.platform.arch }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
build/*
dist/*
.lock-wscript
npm-debug.log
.idea
Debug
*.log
node_modules
prebuilds/*
angle/build/*
example/**/*.ppm
4.6.1
Expand Down
4 changes: 2 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
example/*
test/*
.github
.travis.yml
appveyor.yml
build/*
prebuilds/*
scripts/*
dist/*
4.6.1
5.12.0
6.9.1
Expand Down
Loading

0 comments on commit eabe7d2

Please sign in to comment.