This commit is contained in:
David Sanders 2024-11-13 03:39:52 -08:00 коммит произвёл GitHub
Родитель 3df9e336b2
Коммит c3a04e13c6
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
6 изменённых файлов: 86 добавлений и 40 удалений

Просмотреть файл

@ -1,37 +0,0 @@
version: 2.1
orbs:
cfa: continuousauth/npm@2.1.1
node: electronjs/node@2.3.1
workflows:
test_and_release:
# Run the test jobs first, then the release only when all the test jobs are successful
jobs:
- node/test:
name: test-<< matrix.executor >>-<< matrix.node-version >>
pre-steps:
- run: git config --global core.autocrlf input
matrix:
alias: test
parameters:
executor:
- node/linux
- node/macos
- node/windows
node-version:
- '20.10'
- '18.18'
- '16.20'
- '14.21'
exclude:
- executor: node/macos
node-version: '14.21'
- cfa/release:
requires:
- test
filters:
branches:
only:
- main
context: cfa-release

35
.github/workflows/release.yml поставляемый Normal file
Просмотреть файл

@ -0,0 +1,35 @@
name: Release
on:
push:
branches:
- main
jobs:
test:
uses: ./.github/workflows/test.yml
release:
name: Release
runs-on: ubuntu-latest
needs: test
environment: npm
permissions:
id-token: write # for CFA and npm provenance
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: 20.x
cache: 'yarn'
- name: Install
run: yarn install --frozen-lockfile
- uses: continuousauth/action@c32f05c950d4e6f4abd8d1d8a46269525e2dbf55 # v1.0.3
with:
project-id: ${{ secrets.CFA_PROJECT_ID }}
secret: ${{ secrets.CFA_SECRET }}
npm-token: ${{ secrets.NPM_TOKEN }}

43
.github/workflows/test.yml поставляемый Normal file
Просмотреть файл

@ -0,0 +1,43 @@
name: Test
on:
pull_request:
branches:
- main
schedule:
- cron: '0 22 * * 3'
workflow_call:
permissions:
contents: read
jobs:
test:
name: Test
strategy:
matrix:
node-version:
- '20.10'
- '18.18'
- '16.20'
- '14.21'
os:
- macos-latest
- ubuntu-latest
- windows-latest
exclude:
- os: macos-latest
node-version: '14.21'
runs-on: "${{ matrix.os }}"
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version: "${{ matrix.node-version }}"
cache: 'yarn'
- name: Install
run: yarn install --frozen-lockfile
- name: Test
run: yarn test

Просмотреть файл

@ -56,7 +56,7 @@ BREAKING CHANGE: This removes support for Node 0.10 and 0.12.
Here are some things to keep in mind as you file pull requests to fix bugs, add new features, etc.:
- CircleCI is used to make sure that the project builds packages as expected on the supported platforms, using supported Node.js versions.
- GitHub Actions is used to make sure that the project builds packages as expected on the supported platforms, using supported Node.js versions.
- Unless it's impractical, please write tests for your changes. This will help us so that we can spot regressions much easier.
- Squashing commits during discussion of the pull request is almost always unnecessary, and makes it more difficult for both the submitters and reviewers to understand what changed in between comments. However, rebasing is encouraged when practical, particularly when there's a merge conflict.
- If you are continuing the work of another person's PR and need to rebase/squash, please retain the attribution of the original author(s) and continue the work in subsequent commits.

Просмотреть файл

@ -1,6 +1,6 @@
# Node.js ABI
[![Build Status](https://circleci.com/gh/electron/node-abi/tree/main.svg?style=shield)](https://circleci.com/gh/electron/node-abi/tree/main)
[![Build Status](https://github.com/electron/node-abi/actions/workflows/test.yml/badge.svg)](https://github.com/electron/node-abi/actions/workflows/test.yml)
[![Auto-update ABI JSON file](https://github.com/electron/node-abi/actions/workflows/update-abi.yml/badge.svg)](https://github.com/electron/node-abi/actions/workflows/update-abi.yml)
[![Snyk badge](https://snyk.io/test/github/electron/node-abi/badge.svg)](https://snyk.io/test/github/electron/node-abi)
[![npm version](http://img.shields.io/npm/v/node-abi.svg)](https://npmjs.org/package/node-abi)
@ -8,11 +8,13 @@
Get the Node ABI (application binary interface) for a given target and runtime, and vice versa.
## Installation
```
```shell
npm install node-abi
```
## Usage
```javascript
const nodeAbi = require('node-abi')

Просмотреть файл

@ -35,5 +35,8 @@
},
"engines": {
"node": ">=10"
},
"publishConfig": {
"provenance": true
}
}