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
42 changes: 42 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish to NPM

on:
release:
types: [published]
workflow_dispatch:

jobs:
build:
uses: ./.github/workflows/build.yml
with:
python-version: '3.10'
node-version: 'v18.16.0'

npm-publish:
name: Upload release to NPM
runs-on: ubuntu-latest
environment:
name: npm
permissions:
id-token: write
contents: read
needs: build
steps:
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Download npm package
uses: actions/download-artifact@v4
with:
name: npm-package
path: npm-dist/
- name: Publish to npm
run: |
pushd npm-dist
FILE=$(echo *.tgz)
npm publish "$FILE" --provenance --access public
popd
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
shell: bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish to PyPI & NPM
name: Publish to PyPI

on:
release:
Expand Down Expand Up @@ -30,22 +30,3 @@ jobs:
path: dist/
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

- name: Download npm package
uses: actions/download-artifact@v4
with:
name: npm-package
path: npm-dist/
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Publish to npm
run: |
pushd npm-dist
FILE=$(echo *.tgz)
npm publish "$FILE" --provenance --access public
popd
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
shell: bash
Loading