Skip to content

chore: bump version to 2.2.2 in package.json #37

chore: bump version to 2.2.2 in package.json

chore: bump version to 2.2.2 in package.json #37

Workflow file for this run

name: Build and Publish
on:
push:
tags:
- 'v*'
workflow_dispatch:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
environment: prod
steps:
- name: Checkout code
uses: actions/checkout@v4.1.1
- run: corepack enable
- name: Set up Node.js
uses: actions/setup-node@v4.0.2
with:
node-version: '20'
- name: Install dependencies
run: pnpm install
- name: Run linter
run: pnpm lint
- name: Build the package
run: pnpm build
- name: Dry-run publishing
run: pnpm publish --dry-run
- name: Get version
id: get_version
run: |
VERSION=$(jq -r .version package.json)
echo "Version: $VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ env.VERSION }}
name: Release v${{ env.VERSION }}
draft: false
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
- name: Authenticate npm
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- name: Check token and Publish to npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
if [ -z "$NODE_AUTH_TOKEN" ]; then
echo "NPM_TOKEN is not set."
exit 1
else
echo "NPM_TOKEN is set."
pnpm publish --access public
fi