Release npm package #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
run-name: Release npm package ${{ inputs.channel }} | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- package.json | |
workflow_dispatch: | |
inputs: | |
channel: | |
type: choice | |
description: 'The npm dist-tag to publish to (default: `latest`)' | |
default: latest | |
options: | |
- latest | |
- next | |
jobs: | |
release: | |
permissions: | |
contents: write | |
id-token: write | |
name: npm release | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
cache: npm | |
- run: make compile | |
- uses: JS-DevTools/npm-publish@v3.1.1 | |
id: publish | |
with: | |
token: ${{ secrets.NPM_TOKEN }} | |
tag: ${{ inputs.channel }} | |
provenance: true | |
- run: | | |
git tag -a ${{ steps.publish.outputs.version }}@${{ inputs.channel }} | |
git push --tags | |
if: ${{ steps.publish.outputs.type }} | |
- run: git status | |
- run: git log --oneline |