-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (40 loc) · 1.27 KB
/
hajar-beta.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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