Skip to content
/ libs Public

Automated NPM Library Publishing Template πŸš€

Notifications You must be signed in to change notification settings

Elpiu/libs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Automated NPM Library Publishing Template πŸš€

This branch serves as a template for automating the process of publishing libraries to NPM. You can add a new library and configure a dedicated GitHub workflow to handle its publishing seamlessly.

Additionally, you can run GitHub Actions locally using the gh act extension for easier testing and debugging.

Features ✨

  • Template for multiple libraries: Easily add and manage new libraries for automated publishing.
  • GitHub Actions integration: Configure workflows for automatic builds and publishing.
  • Local Action testing: Test and debug workflows on your local machine before pushing changes.

img

Run GitHub Actions Locally πŸš€

To run workflows locally, you need to install the gh act extension see gh-act.

After installation run:

gh act -j 'job-name' --pull=false

Adding a New Library πŸ› οΈ

  • Create the library: Add your library under the appropriate folder in the repository.
  • Write a workflow: Define a GitHub workflow for the library, specifying its build and publishing steps.
  • Test locally: Use gh act to ensure your workflow is correctly configured.
  • Push to the repository: The workflow will automatically trigger on the appropriate events (e.g., pushes to main).

How to Recreate This Workspace πŸ› οΈ

Follow these steps to set up a new workspace and libraries from scratch:

Step 1: Initialize a New Folder

Create a new folder for your workspace:

mkdir my-workspace
cd my-workspace
git init

Step 2: Create Angular Library

Run the following command to create an Angular workspace without a default application:

ng new my-workspace --no-create-application
cd my-workspace
ng generate library my-lib