Skip to content

Commit a48cfb0

Browse files
authored
Merge pull request #446 from plotly/split-npm-publish-workflow
Split publish into separate PyPI and npm workflows
2 parents c75e41a + 6bfd20c commit a48cfb0

2 files changed

Lines changed: 43 additions & 20 deletions

File tree

.github/workflows/npm-publish.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Publish to NPM
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
uses: ./.github/workflows/build.yml
11+
with:
12+
python-version: '3.10'
13+
node-version: 'v18.16.0'
14+
15+
npm-publish:
16+
name: Upload release to NPM
17+
runs-on: ubuntu-latest
18+
environment:
19+
name: npm
20+
permissions:
21+
id-token: write
22+
contents: read
23+
needs: build
24+
steps:
25+
- uses: actions/setup-node@v4
26+
with:
27+
node-version: '20.x'
28+
registry-url: 'https://registry.npmjs.org'
29+
- name: Download npm package
30+
uses: actions/download-artifact@v4
31+
with:
32+
name: npm-package
33+
path: npm-dist/
34+
- name: Publish to npm
35+
run: |
36+
pushd npm-dist
37+
FILE=$(echo *.tgz)
38+
npm publish "$FILE" --provenance --access public
39+
popd
40+
env:
41+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
42+
shell: bash
Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish to PyPI & NPM
1+
name: Publish to PyPI
22

33
on:
44
release:
@@ -30,22 +30,3 @@ jobs:
3030
path: dist/
3131
- name: Publish package distributions to PyPI
3232
uses: pypa/gh-action-pypi-publish@release/v1
33-
34-
- name: Download npm package
35-
uses: actions/download-artifact@v4
36-
with:
37-
name: npm-package
38-
path: npm-dist/
39-
- uses: actions/setup-node@v4
40-
with:
41-
node-version: '20.x'
42-
registry-url: 'https://registry.npmjs.org'
43-
- name: Publish to npm
44-
run: |
45-
pushd npm-dist
46-
FILE=$(echo *.tgz)
47-
npm publish "$FILE" --provenance --access public
48-
popd
49-
env:
50-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
51-
shell: bash

0 commit comments

Comments
 (0)