Skip to content

Commit

Permalink
chore: publish action to push dist to npm
Browse files Browse the repository at this point in the history
  • Loading branch information
bucurdavid committed Feb 14, 2025
1 parent 000eace commit 1f55247
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 24 deletions.
30 changes: 7 additions & 23 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,21 @@
name: Publish

name: Publish to NPM
on:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: write

jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '23.3.0'
node-version: '20.3.x'
registry-url: https://registry.npmjs.org/

# Install dependencies with pnpm
- uses: pnpm/action-setup@v2
with:
version: latest

- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
RELEASE_TAG=v$(node -p "require('./package.json').version")
gh release create $RELEASE_TAG --target=$GITHUB_SHA --title="$RELEASE_TAG" --generate-notes
- name: Publish to npm
- name: Publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: pnpm publish --access=public --no-git-checks
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --access=public
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

0 comments on commit 1f55247

Please sign in to comment.