Skip to content

Commit 3b30fe9

Browse files
committed
Add PyPI and npm publish to release workflow
1 parent 508657c commit 3b30fe9

1 file changed

Lines changed: 34 additions & 16 deletions

File tree

.github/workflows/release.yml

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77

88
permissions:
99
contents: write
10+
id-token: write
1011

1112
jobs:
1213
build:
@@ -83,19 +84,36 @@ jobs:
8384
files: dist/*
8485
prerelease: ${{ steps.check.outputs.prerelease == 'true' }}
8586

86-
# Uncomment when ready to publish to PyPI:
87-
# pypi-publish:
88-
# needs: [build, test]
89-
# runs-on: ubuntu-latest
90-
# environment: release
91-
# permissions:
92-
# id-token: write
93-
# steps:
94-
# - name: Download artifacts
95-
# uses: actions/download-artifact@v4
96-
# with:
97-
# name: dist
98-
# path: dist/
99-
#
100-
# - name: Publish to PyPI
101-
# uses: pypa/gh-action-pypi-publish@release/v1
87+
pypi-publish:
88+
needs: [build, test]
89+
runs-on: ubuntu-latest
90+
environment: release
91+
permissions:
92+
id-token: write
93+
steps:
94+
- name: Download artifacts
95+
uses: actions/download-artifact@v4
96+
with:
97+
name: dist
98+
path: dist/
99+
100+
- name: Publish to PyPI
101+
uses: pypa/gh-action-pypi-publish@release/v1
102+
103+
npm-publish:
104+
needs: [build, test]
105+
runs-on: ubuntu-latest
106+
environment: release
107+
steps:
108+
- uses: actions/checkout@v4
109+
110+
- name: Set up Node.js
111+
uses: actions/setup-node@v4
112+
with:
113+
node-version: "20"
114+
registry-url: "https://registry.npmjs.org"
115+
116+
- name: Publish to npm
117+
run: npm publish --access public
118+
env:
119+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)