diff --git a/.github/workflows/publish_npm.yml b/.github/workflows/publish_npm.yml new file mode 100644 index 0000000..21cc170 --- /dev/null +++ b/.github/workflows/publish_npm.yml @@ -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 }} diff --git a/package.json b/package.json index f7d2f33..62c4ef5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "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": { @@ -8,7 +8,7 @@ "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",