- NodeJS 16.19.0 (preferiblemente NVM)
- Yarn
Cambiar a NodeJS 16.19.0
nvm use v16.19.0
Instalar Yarn globalmente
npm install -g yarn
Instalar dependencias y inicializar hooks
$ yarn install && yarn husky install
This repository includes a GitHub Action workflow that automatically publishes the package to NPM when changes are merged into the development
branch.
-
Trigger: Pushes to
development
branch - Build Process: Install dependencies, run linting, formatting checks, and build the package
- Publishing: Automatically publishes to NPM registry if the version doesn't already exist
- Version Management: Checks if the current package.json version exists on NPM before publishing
-
NPM Token: Add
NPM_TOKEN
secret to repository settings with a valid NPM authentication token -
Version Management: Update version in
package.json
before merging to development branch -
Package Access: The workflow publishes with
--access public
for scoped packages
-
Build Job:
- Checkout code
- Setup Node.js 16.19.0
- Install dependencies with frozen lockfile
- Run linting (
yarn lint
) - Run formatting check (
yarn format:check
) - Build package (
yarn build
) - Upload build artifacts
-
Publish Job:
- Download build artifacts
- Check if version exists on NPM
- Publish to NPM (if version is new)
- Skip publishing if version already exists
If you need to publish manually:
# Build the package
yarn build
# Publish to NPM
npm publish --access public