Skip to content

Commit bdcc53b

Browse files
committed
publish
1 parent f958782 commit bdcc53b

2 files changed

Lines changed: 44 additions & 2 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: build and publish package
2+
3+
on:
4+
release:
5+
types: [ created ]
6+
7+
jobs:
8+
build-and-publish:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
packages: write
12+
contents: read
13+
steps:
14+
- uses: actions/checkout@v3
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: 18
19+
registry-url: https://npm.pkg.github.com
20+
21+
- name: Update package.json version
22+
uses: jossef/action-set-json-field@v1
23+
with:
24+
file: ./package.json
25+
field: version
26+
value: ${{ github.event.release.name }}
27+
28+
- name: Package install
29+
run: npm install
30+
31+
- name: Publish package
32+
run: npm publish --access public
33+
env:
34+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,21 @@
22
"name": "@cuculus/validators",
33
"version": "0.1.0",
44
"description": "",
5-
"main": "index.js",
5+
"main": "dist/index.js",
6+
"types": "dist/index.d.ts",
7+
"files": [
8+
"dist"
9+
],
10+
"publishConfig": {
11+
"registry": "https://registry.npmjs.org/"
12+
},
613
"scripts": {
714
"build": "tsc -p tsconfig.build.json",
815
"test": "jest",
916
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,css,scss,html}\"",
1017
"prepare": "husky install",
11-
"lint-staged": "lint-staged"
18+
"lint-staged": "lint-staged",
19+
"prepublishOnly": "tsc -p tsconfig.build.json"
1220
},
1321
"husky": {
1422
"hooks": {

0 commit comments

Comments
 (0)