Skip to content

Commit 9178112

Browse files
authored
publish to npm as part of release workflow (#568)
* publish to npm as part of release workflow * delete separate publish-npm workflow file * update nodejs version
1 parent 188b7ec commit 9178112

File tree

2 files changed

+27
-40
lines changed

2 files changed

+27
-40
lines changed

.github/workflows/publish-npm.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,33 @@ jobs:
189189
GH_REPO: ${{ github.repository }}
190190
run: gh release edit "${{ needs.create-release.outputs.railway_version }}" --draft=false
191191

192+
publish-npm:
193+
name: Publish NPM
194+
needs: ["create-release", "build-release", "publish-release"]
195+
runs-on: ubuntu-lates
196+
197+
steps:
198+
- name: Use Node.js
199+
uses: actions/setup-node@v1
200+
with:
201+
node-version: 22
202+
registry-url: https://registry.npmjs.org/
203+
204+
- name: Setup Git user
205+
run: |
206+
git config --global user.name "Github Bot"
207+
git config --global user.email "[email protected]"
208+
209+
- name: Create .npmrc file
210+
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
211+
env:
212+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
213+
214+
- name: NPM publish
215+
run: npm publish --access public
216+
env:
217+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
218+
192219
notify-release:
193220
name: Notify Release
194221
needs: ["create-release", "build-release", "publish-release"]

0 commit comments

Comments
 (0)