Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/actions/publish/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Publish
description: Publish to npm

inputs:
token:
description: 'npm token'
required: true

runs:
steps:
# see https://github.com/google-github-actions/release-please-action#automating-publication-to-npm
# see https://docs.npmjs.com/generating-provenance-statements
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: ./.github/actions/prepare
- name: Publish to npm
env:
NODE_AUTH_TOKEN: ${{ inputs.token }}
run: npm publish --provenance --access public --registry https://registry.npmjs.org
shell: bash
using: composite
21 changes: 21 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Publish to npm

on:
release:
types: [published]
workflow_dispatch:

permissions:
contents: read
id-token: write

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Publish to npm
uses: ./.github/actions/publish
with:
token: ${{ secrets.NPM_TOKEN }}
28 changes: 0 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,11 @@ on:
permissions:
contents: write
pull-requests: write
id-token: write

jobs:
release-please:
name: Release Please
runs-on: ubuntu-latest
steps:
- name: Create Release
id: release
uses: googleapis/release-please-action@a02a34c4d625f9be7cb89156071d8567266a2445 # v4

# see https://github.com/google-github-actions/release-please-action#automating-publication-to-npm
- name: Checkout Repository
if: ${{ steps.release.outputs.release_created }}
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup Node.js
if: ${{ steps.release.outputs.release_created }}
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'

- name: Install
if: ${{ steps.release.outputs.release_created }}
uses: bahmutov/npm-install@6bbff949458c1dd99b20e185cee8c4d6fcf1212a # v1.10.9

- name: Build
if: ${{ steps.release.outputs.release_created }}
run: npm run build

- name: Publish to npm
if: ${{ steps.release.outputs.release_created }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: npm publish --provenance --access public