Skip to content

Bump version to 0.2.0 for trusted publishing #8

Bump version to 0.2.0 for trusted publishing

Bump version to 0.2.0 for trusted publishing #8

Workflow file for this run

name: CI
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
release:
types:
- published
workflow_dispatch:
permissions:
contents: read
jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
target: x86_64-unknown-linux-gnu
- os: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
- os: macos-15-intel
target: x86_64-apple-darwin
- os: macos-15
target: aarch64-apple-darwin
- os: windows-2022
target: x86_64-pc-windows-msvc
- os: windows-11-arm
target: aarch64-pc-windows-msvc
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
- uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
- uses: dtolnay/rust-toolchain@4be7066ada62dd38de10e7b70166bc74ed198c30
with:
toolchain: stable
targets: ${{ matrix.target }}
- name: Install Linux native dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libdbus-1-dev libssl-dev
- run: npm ci
- run: npm run build -- --target ${{ matrix.target }}
- name: Upload native binding
uses: actions/upload-artifact@v7
with:
name: binding-${{ matrix.target }}
path: webauthn_authenticator.*.node
if-no-files-found: error
- name: Upload JS loader and types
if: matrix.target == 'x86_64-unknown-linux-gnu'
uses: actions/upload-artifact@v7
with:
name: loader-and-types
path: |
index.js
index.d.ts
if-no-files-found: error
publish:
name: Publish npm packages
if: github.event_name == 'release' && github.event.action == 'published'
needs: build
runs-on: ubuntu-24.04
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
- uses: actions/setup-node@v6
with:
node-version: 24
package-manager-cache: false
registry-url: https://registry.npmjs.org
- run: npm ci
- run: npm run build:dirs
- uses: actions/download-artifact@v8
with:
path: artifacts
merge-multiple: true
- run: |
cp artifacts/index.js ./index.js
cp artifacts/index.d.ts ./index.d.ts
npx napi artifacts --output-dir artifacts --npm-dir npm
- name: Publish optional native packages
run: npx napi pre-publish
env:
NPM_CONFIG_PROVENANCE: true
- name: Publish root package
run: npm publish --access public
env:
NPM_CONFIG_PROVENANCE: true