Skip to content

v0.2.3

v0.2.3 #75

Workflow file for this run

name: publish-package
on:
release:
types: [created]
workflow_dispatch:
inputs:
version:
description: 'Package version (e.g., 1.2.3) - leave empty to use package.json version'
required: false
type: string
tag:
description: 'NPM tag (latest, beta, next, etc.)'
required: false
default: 'latest'
type: string
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Update version if specified
if: ${{ github.event.inputs.version != '' }}
run: |
npm version ${{ github.event.inputs.version }} --no-git-tag-version
echo "Updated package.json to version ${{ github.event.inputs.version }}"
- name: Generate NitroModule bindings
run: yarn nitro-codegen
- name: Build package
run: yarn prepare
- name: Configure npm for publishing
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- name: Publish with tag
if: ${{ github.event.inputs.tag != '' }}
run: npm publish --tag ${{ github.event.inputs.tag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish (default)
if: ${{ github.event.inputs.tag == '' }}
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}