Skip to content

Commit f728395

Browse files
committed
chore: npm publish eslint-config-ivy
1 parent d9385eb commit f728395

File tree

3 files changed

+91
-14
lines changed

3 files changed

+91
-14
lines changed

.github/workflows/npmpublish.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Publish Package
2+
3+
on:
4+
push:
5+
branches:
6+
- release
7+
8+
jobs:
9+
npm_publish:
10+
if: "! contains(toJSON(github.event.commits.*.message), '[Version Bump]')"
11+
name: NPM Publish
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
node-version: [20.x]
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
token: ${{ secrets.HOUZZ_CI_TOKEN }}
20+
21+
- name: Setup GIT
22+
run: |
23+
git config user.email "[email protected]"
24+
git config user.name "houzz-ci"
25+
26+
- uses: actions/setup-node@v3
27+
with:
28+
node-version: ${{ matrix.node-version }}
29+
registry-url: https://npm.pkg.github.com/
30+
scope: houzz
31+
32+
- name: Bump up patch version and push to github
33+
run: |
34+
npm version patch -m "chore: [Version Bump] %s"
35+
git push "https://github.com/$GITHUB_REPOSITORY" release --no-verify
36+
env:
37+
NODE_AUTH_TOKEN: ${{ secrets.HOUZZ_CI_TOKEN }}
38+
39+
- name: Publish package to github registry
40+
run: |
41+
npm publish --tag "latest" ./ > publish_message.txt
42+
echo "##[set-output name=message;]$(cat publish_message.txt)"
43+
env:
44+
NODE_AUTH_TOKEN: ${{ secrets.HOUZZ_CI_TOKEN }}

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,37 @@
11
# eslint-config-ivy
22

3+
> ⚠️ **CAUTION**
4+
> We now have a published package available on npm! However, for backward compatibility, we need to maintain two branches for now:
5+
>
6+
> - **`master`**: For legacy usage (`github:Houzz/eslint-config-ivy#master`).
7+
> - **`release`**: For the new npm package (`@houzz/eslint-config-ivy`).
8+
>
9+
> Please migrate all old usages to the new package as soon as possible. The legacy branch will eventually be deprecated.
10+
311
## Usage
412

13+
New (Recommended): Install the latest version from npm
14+
15+
```sh
16+
npm install @houzz/eslint-config-ivy --save-dev
17+
```
18+
19+
```json
20+
// .eslintrc
21+
{
22+
"extends": ["@houzz/eslint-config-ivy"]
23+
}
24+
```
25+
26+
Legacy (Deprecated): For temporary backward compatibility
27+
528
```sh
629
npm install github:Houzz/eslint-config-ivy#master
730
```
31+
32+
```json
33+
// .eslintrc
34+
{
35+
"extends": ["eslint-config-ivy"]
36+
}
37+
```

package.json

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
{
2-
"name": "eslint-config-ivy",
3-
"version": "1.0.1",
4-
"description": "Eslint configuration for ivy projects",
5-
"main": "index.js",
6-
"exports": {
7-
".": "./index.js",
8-
"./stylelint": "./stylelint.js",
9-
"./package.json": "./package.json"
10-
},
11-
"scripts": {
12-
"test": "echo \"Error: no test specified\" && exit 1"
13-
},
14-
"author": "",
15-
"license": "ISC"
2+
"name": "@houzz/eslint-config-ivy",
3+
"version": "1.0.49",
4+
"description": "ESlint configuration for ivy projects",
5+
"main": "index.js",
6+
"exports": {
7+
".": "./index.js",
8+
"./stylelint": "./stylelint.js",
9+
"./package.json": "./package.json"
10+
},
11+
"scripts": {
12+
"test": "echo \"Error: no test specified\" && exit 1"
13+
},
14+
"publishConfig": {
15+
"registry": "https://npm.pkg.github.com/Houzz"
16+
},
17+
"author": "",
18+
"license": "ISC"
1619
}

0 commit comments

Comments
 (0)