Skip to content

Commit 7c78f31

Browse files
author
Thom van Kalkeren
committed
Automate prepublish
1 parent 1770a92 commit 7c78f31

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

.github/workflows/npm-publish.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3+
4+
name: Node.js Package
5+
6+
on:
7+
push:
8+
branches:
9+
- "*"
10+
tags:
11+
- v*
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-node@v3
18+
with:
19+
node-version: 16
20+
cache: 'yarn'
21+
- run: yarn install --frozen-lockfile
22+
- run: yarn build
23+
- run: yarn test
24+
continue-on-error: true
25+
26+
pre-publish-npm:
27+
needs: build
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v3
31+
- uses: actions/setup-node@v3
32+
with:
33+
node-version: 16
34+
registry-url: https://registry.npmjs.org/
35+
- run: yarn install --frozen-lockfile
36+
- run: yarn build
37+
- run: npm version --no-git-tag-version prerelease --preid=dev.$GITHUB_SHA
38+
working-directory: ./pkg
39+
- run: npm publish --tag dev
40+
working-directory: ./pkg
41+
env:
42+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "The Link library for creating information based applications",
55
"repository": "https://github.com/rescribet/link-lib.git",
66
"scripts": {
7-
"build": "pika build",
7+
"build": "./node_modules/.bin/pika build",
88
"lint": "tslint -c tslint.json 'src/**/*.{ts,tsx}'",
99
"prepublish": "npm run build",
1010
"pretest": "npm run lint",

0 commit comments

Comments
 (0)