Skip to content

Commit 932e39b

Browse files
committed
npm package build
1 parent 0335bbc commit 932e39b

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

.github/workflows/build-npm.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: NPM package
2+
'on':
3+
push:
4+
tags:
5+
- v[0-9]+.[0-9]+.[0-9]+
6+
jobs:
7+
build:
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
matrix:
11+
os:
12+
- ubuntu-22.04
13+
steps:
14+
- name: Context
15+
env:
16+
GITHUB_CONTEXT: ${{ toJson(github) }}
17+
run: echo "$GITHUB_CONTEXT"
18+
- uses: actions/checkout@v2
19+
with:
20+
fetch-depth: 1
21+
- name: Use Node.js 22.x
22+
uses: actions/setup-node@v1
23+
with:
24+
node-version: 22.x
25+
- name: Configure NPM token
26+
env:
27+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
28+
run: |
29+
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
30+
- name: npm install
31+
run: |
32+
npm install
33+
- name: Publish
34+
run: |
35+
npm publish

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
2-
"name": "gitdiff",
2+
"name": "diflow",
33
"version": "1.0.0",
4+
"bin": {
5+
"diflow": "./dist/diflow.js"
6+
},
47
"scripts": {
58
"build": "tsc",
69
"test": "npm run build && jest --runInBand",
@@ -10,6 +13,11 @@
1013
"test:dbgate": "yarn tsc && node dist/diflow sync -r https://github.com/dbgate/dbgate-diflow-config.git -b master --skip-push --clear",
1114
"test:dbgate:push": "yarn tsc && node dist/diflow sync -r https://github.com/dbgate/dbgate-diflow-config.git -b master --clear"
1215
},
16+
"files": [
17+
"LICENSE",
18+
"README.md",
19+
"dist"
20+
],
1321
"devDependencies": {
1422
"@types/fs-extra": "^11.0.4",
1523
"@types/jest": "^29.5.12",

0 commit comments

Comments
 (0)