Skip to content

Commit

Permalink
publish to npm as part of release workflow (#568)
Browse files Browse the repository at this point in the history
* publish to npm as part of release workflow

* delete separate publish-npm workflow file

* update nodejs version
  • Loading branch information
coffee-cup authored Oct 22, 2024
1 parent 188b7ec commit 9178112
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 40 deletions.
40 changes: 0 additions & 40 deletions .github/workflows/publish-npm.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,33 @@ jobs:
GH_REPO: ${{ github.repository }}
run: gh release edit "${{ needs.create-release.outputs.railway_version }}" --draft=false

publish-npm:
name: Publish NPM
needs: ["create-release", "build-release", "publish-release"]
runs-on: ubuntu-lates

steps:
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 22
registry-url: https://registry.npmjs.org/

- name: Setup Git user
run: |
git config --global user.name "Github Bot"
git config --global user.email "[email protected]"
- name: Create .npmrc file
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: NPM publish
run: npm publish --access public
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

notify-release:
name: Notify Release
needs: ["create-release", "build-release", "publish-release"]
Expand Down

0 comments on commit 9178112

Please sign in to comment.