SIKKA-5128[IN PROGRESS] #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Hajar CI - @beta | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.npm_token}} | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
NPM_PUBLISH_TAG: beta # Specify the tag for publishing | |
on: | |
push: | |
branches: [main] | |
jobs: | |
publish-package: | |
if: ${{!contains(github.event.head_commit.message, 'skip_publish')}} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.x] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Append -beta to package.json version | |
run: | | |
node -e "const fs = require('fs'); const packageJson = require('./package.json'); packageJson.version += '-beta'; fs.writeFileSync('./package.json', JSON.stringify(packageJson, null, 2));" | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 16 | |
registry-url: https://registry.npmjs.org/ | |
always-auth: true | |
- name: Install dependencies | |
run: | | |
if [ -e 'package-lock.json' ]; then | |
npm ci | |
else | |
npm install | |
fi | |
- name: Build Library | |
run: npm run build --if-present | |
- name: Test & Lint | |
run: | | |
npm run test:coverage --if-present | |
npm run lint --if-present | |
- name: Publish to NPM @beta tag | |
run: npm publish --tag $NPM_PUBLISH_TAG |