Skip to content

add license to package.json #16

add license to package.json

add license to package.json #16

Workflow file for this run

name: CD
on:
push:
branches:
- main
defaults:
run:
shell: bash
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use pnpm 9.x
uses: pnpm/action-setup@v4
with:
version: 9.x
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run tests
run: pnpm test
publish:
name: Publish
runs-on: ubuntu-latest
needs: test # This ensures tests must pass before publishing
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use pnpm 9.x
uses: pnpm/action-setup@v4
with:
version: 9.x
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup Git config
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Bump version
run: npm version patch
- name: Push version change
run: |
git push
git push --tags
# Build happens on "prepare" (before publish)
- name: Publish to npm
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}