Skip to content

Commit fea219f

Browse files
committed
Update package meta data and Github Workflows
1 parent dd4eb80 commit fea219f

File tree

4 files changed

+53
-11
lines changed

4 files changed

+53
-11
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish Package to npmjs
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-node@v3
13+
with:
14+
node-version: "16.x"
15+
- run: npm ci --ignore-scripts
16+
- run: npm run build
17+
name: Build
18+
- uses: actions/upload-artifact@v3
19+
with:
20+
name: build-files
21+
path: lib/
22+
23+
publish:
24+
needs: build
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v3
28+
- uses: actions/setup-node@v3
29+
with:
30+
node-version: "16.x"
31+
registry-url: "https://registry.npmjs.org"
32+
- uses: actions/download-artifact@v3
33+
with:
34+
name: build-files
35+
path: lib/
36+
- run: npm publish --ignore-scripts
37+
env:
38+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
name: test
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch:
48

59
jobs:
610
test:
711
name: Test Node v${{ matrix.node }}
812
strategy:
913
matrix:
10-
node: ["12", "14", "16"]
14+
node: ["12.x", "14.x", "16.x"]
1115
runs-on: ubuntu-latest
1216
steps:
1317
- uses: actions/checkout@v3
1418
- uses: actions/setup-node@v3
1519
with:
1620
node-version: ${{ matrix.node }}
17-
- run: npm ci
21+
- run: npm ci --ignore-scripts
22+
- run: npm run build
23+
name: Build
1824
- run: npm test

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"name": "pg-composite",
2+
"name": "postgres-composite",
33
"version": "0.1.0",
44
"description": "Parse and serialize PostgreSQL composite values",
55
"main": "lib/index.js",
66
"types": "lib/index.d.ts",
7-
"repository": "github.com/boromisp/node-pg-composite",
7+
"repository": "github.com/boromisp/postgres-composite",
88
"author": "Peter B",
99
"license": "MIT",
1010
"engines": {
@@ -21,9 +21,7 @@
2121
],
2222
"scripts": {
2323
"build": "tsc",
24-
"prebuild": "npm run prettier -- -c",
2524
"prettier": "prettier ./src",
26-
"test": "node test.js",
27-
"pretest": "npm run build"
25+
"test": "node test.js"
2826
}
2927
}

0 commit comments

Comments
 (0)