This directory contains GitHub Actions workflows for automating project tasks.
This workflow handles automatic publishing to NPM when changes are merged to the main branch.
- Trigger: Runs on push to the
main
branch, ignoring documentation files and workflow changes - Jobs:
publish
: Builds, verifies, and publishes the package to NPM
- Setup: Prepares the environment with Node.js and pnpm
- Quality Checks: Runs linting and type checking
- Build Process: Cleans, builds, and verifies the package
- Version Management: Uses Changesets to handle versioning
- Publishing:
- If changesets detects unpublished changes, it creates a release PR or publishes directly
- If no changesets are present, it checks if the current version needs publishing
NPM_TOKEN
: NPM authentication token with publish permissions- To create this token:
- Go to npmjs.com and log in
- Navigate to your profile → Access Tokens
- Create a new token with "Automation" type
- Add the token to your repository secrets in GitHub
- To create this token:
If the workflow fails:
- Build Failures: Check the logs for linting, type, or build errors
- Publish Failures: Verify your NPM_TOKEN has proper permissions
- Version Conflicts: Check if the version in package.json is already published
If you need to manually trigger the workflow:
- Create a small change to the codebase
- Push to a feature branch
- Create a PR to main
- Once merged, the workflow will automatically run
The publishing process uses Changesets to manage versioning.
- Make your code changes
- Run
pnpm changeset
to create a new changeset - Select the packages to include (for monorepos)
- Choose the version bump type (patch, minor, major)
- Write a description of your changes
- Commit the generated changeset file with your changes
- When your changes are merged to main, the workflow will handle versioning and publishing
pnpm changeset
- Create a new changesetpnpm version-packages
- Apply changesets and update versionspnpm release
- Publish packages updated by changesets