You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: publish-npm/README.md
+63-19Lines changed: 63 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,30 +2,50 @@
2
2
3
3
## Overview 🌟
4
4
5
-
This reusable GitHub Actions workflow automates the process of publishing an NPM package. It is configurable via inputs for the package scope, Node.js version, registry URL, and other options. The workflow performs the following actions:
5
+
This reusable GitHub Actions workflow automates the process of publishing an NPM package. It is configurable via inputs
6
+
for the package scope, Node.js version, registry URL, and other options. The workflow performs the following actions:
6
7
8
+
-**Downloads Artifacts**: Downloads specified artifacts if needed. 📦
7
9
-**Checks Out Your Repository**: Retrieves your code. 📥
8
10
-**Sets Up Node.js**: Installs the specified Node.js version and configures the `.npmrc` file. ⚙️
9
-
-**Installs Dependencies**: Uses `npm ci` to install the dependencies. 📦
10
-
-**Publishes the Package**: Publishes the package with provenance (if enabled) and the specified access level using `npm publish`. 🎉
11
+
-**Installs Dependencies**: Uses the specified install command (default: `npm ci`) to install the dependencies. 📦
12
+
-**Builds the Package**: Builds the package using the specified build command (default: `npm run build`). 🔨
13
+
-**Performs Type Checking**: Runs type checking if configured. 🔍
14
+
-**Checks Code Formatting**: Verifies code formatting if configured. 🧹
15
+
-**Runs Linting**: Performs code linting if configured. 🧹
16
+
-**Runs Tests**: Executes unit tests if enabled. ✅
17
+
-**Publishes the Package**: Publishes the package with provenance (if enabled) and the specified access level using
Ensure that the `NPM_TOKEN` secret is added to your repository’s settings. This token is required to authenticate with the NPM registry during publishing. 🔑
95
+
Ensure that the `NPM_TOKEN` secret is added to your repository’s settings. This token is required to authenticate
96
+
with the NPM registry during publishing. 🔑
97
+
98
+
## Workflow Steps in Detail 🔍
99
+
100
+
1. **Download Artifacts**: If `artifact-name` is provided, downloads the specified artifact using `actions/download-artifact@v4` to the path specified by `artifact-path`.
101
+
2. **Checkout Repository**: Uses `actions/checkout@v4` to fetch your code.
102
+
3. **Setup Node.js**: Configures Node.js with `actions/setup-node@v4`, including registry URL and scope configuration.
0 commit comments