Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Node.js Package Release Workflow | |
on: | |
release: | |
types: [created] | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
ref: refs/heads/main | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
registry-url: https://registry.npmjs.org/ | |
# Install pnpm | |
- name: Install pnpm | |
run: npm install -g pnpm | |
# Setup Git | |
- name: Setup Git | |
run: | | |
git config user.name "github-actions" | |
git config user.email "[email protected]" | |
# Update package version | |
- name: Update package version | |
run: | | |
VERSION=${GITHUB_REF#refs/tags/} | |
npm version $VERSION --no-git-tag-version | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Install dependencies | |
- run: pnpm install | |
# Build the package | |
- run: pnpm run build | |
# Publish to npm | |
- run: pnpm publish --no-git-checks | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |