Skip to content

Commit 46c5994

Browse files
committed
try v0.0.2
1 parent 447ef37 commit 46c5994

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

README.md

+22-2
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,33 @@ npm uninstall example-typescript-package -g
8787

8888
### Publish
8989

90+
Create an [npm](https://www.npmjs.com/) account.
91+
9092
#### Manual Publishing
9193

92-
...
94+
Log in:
95+
96+
```bash
97+
npm adduser
98+
```
99+
100+
And publish:
101+
102+
```bash
103+
npm publish
104+
```
93105

94106
#### CI Publishing
95107

96-
...
108+
This package is configured to use GitHub Actions CI/CD to automate the npm publishing process. The following are what you have to do.
109+
110+
Follow [npm's official instruction](https://docs.npmjs.com/creating-and-viewing-access-tokens) to create an npm token. Choose "Publish" from the website, or use `npm token create` without argument with the CLI.
111+
112+
If you use 2FA, then make sure it's enabled for **authorization** only instead of **authorization and publishing** (**Edit Profile** -> **Modify 2FA**).
113+
114+
On the page of your newly created or existing GitHub repo, click **Settings** -> **Secrets** -> **New repository secret**, the **Name** should be `NPM_TOKEN` and the **Value** should be your npm token.
115+
116+
When you publish a brand new package, you may encounter some issue https://github.com/npm/cli/issues/1637
97117

98118
## Notes
99119

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "example-typescript-package",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"description": "",
55
"main": "dist/cjs/index.js",
66
"module": "dist/esm/index.js",

0 commit comments

Comments
 (0)