Skip to content

Commit

Permalink
Automate prepublish
Browse files Browse the repository at this point in the history
  • Loading branch information
Thom van Kalkeren committed Aug 1, 2022
1 parent 1770a92 commit 7c78f31
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Node.js Package

on:
push:
branches:
- "*"
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
- run: yarn install --frozen-lockfile
- run: yarn build
- run: yarn test
continue-on-error: true

pre-publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: yarn install --frozen-lockfile
- run: yarn build
- run: npm version --no-git-tag-version prerelease --preid=dev.$GITHUB_SHA
working-directory: ./pkg
- run: npm publish --tag dev
working-directory: ./pkg
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "The Link library for creating information based applications",
"repository": "https://github.com/rescribet/link-lib.git",
"scripts": {
"build": "pika build",
"build": "./node_modules/.bin/pika build",
"lint": "tslint -c tslint.json 'src/**/*.{ts,tsx}'",
"prepublish": "npm run build",
"pretest": "npm run lint",
Expand Down

0 comments on commit 7c78f31

Please sign in to comment.