GitHub Action for publishing npm packages with pnpm and creating GitHub releases.
# .github/workflows/release.yml
name: Release
on:
push:
tags: ['v*']
jobs:
release:
uses: runsascoded/gh-pnpm-release/.github/workflows/release.yml@v1
secrets:
npm_token: ${{ secrets.NPM_TOKEN }}# .github/workflows/release.yml
name: Release
on:
push:
tags: ['v*']
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: runsascoded/gh-pnpm-release@v1
with:
npm_token: ${{ secrets.NPM_TOKEN }}- Checks out your code at the tag
- Sets up pnpm and Node.js, installs dependencies
- Runs your build command (default:
pnpm run build) - Publishes to npm with
pnpm publish - Creates a GitHub release with auto-generated release notes
- Outputs links to NPM and GitHub releases (in logs and as workflow annotations)
| Input | Description | Default |
|---|---|---|
npm_token |
NPM authentication token | (required) |
node_version |
Node.js version | '20' |
pnpm_version |
pnpm version | '10' |
build_command |
Build command to run | 'pnpm run build' |
publish_args |
Additional args for pnpm publish |
'--access public --no-git-checks' |
Just push a tag:
git tag v1.0.0
git push origin v1.0.0The action handles building, publishing to npm, and creating the GitHub release with auto-generated notes.
- gh-pnpm-dist - Sibling action for building and maintaining npm package distribution branches
MIT