Skip to content

Commit

Permalink
ci: add github actions for automatic test/deploy to npm package on ev…
Browse files Browse the repository at this point in the history
…ery new release

ci: removed useless build step , move yarn install before tests

ci: use caching for dependencies

ci(package.json): convert husky install condintional , depending current environment

ci: remove cache from publish job
  • Loading branch information
Kos-M committed Sep 28, 2022
1 parent c30ae86 commit eb453c6
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/publish_npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish to NPM
on:
release:
types: [created]

jobs:

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'yarn'
- run: yarn --frozen-lockfile
- run: yarn run test

publish:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
scope: '@t13'
- run: yarn --frozen-lockfile
- name: Publish package on NPM 📦
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "queue-xec-master",
"version": "2.0.2",
"version": "2.0.3",
"description": "Master queue, push jobs and gathers results from online workers.",
"main": "index.js",
"scripts": {
"test": "jest --forceExit",
"test:dev": "jest --watch ",
"lint": "eslint --ext .js,.ts .",
"format": "prettier --write .",
"prepare": "husky install"
"prepare": "node -e \"if (process.env.NODE_ENV !== 'production'){process.exit(1)} \" || husky install"
},
"author": "KosM",
"license": "MIT",
Expand Down

0 comments on commit eb453c6

Please sign in to comment.