Skip to content

itcode-dev/eslint-config NPM Publish #59

itcode-dev/eslint-config NPM Publish

itcode-dev/eslint-config NPM Publish #59

# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
name: itcode-dev/eslint-config NPM Publish
on:
push:
tags:
- v*
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org/
- name: Setup PNPM
uses: pnpm/action-setup@v4
with:
version: 8
- name: Cache dependencies
id: cache
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-eslint-config-itcode-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-eslint-config-itcode
- name: Dependencies Install
if: steps.cache.outputs.cache-hit != 'true'
run: pnpm install
- name: build script
run: pnpm rollup -c
- name: NPM Publish
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}}