-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (50 loc) · 1.63 KB
/
release.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
50
51
52
53
54
55
name: Publish
on:
push:
branches:
- master
jobs:
publish-gpr:
runs-on: ubuntu-latest
# if: startsWith( github.event.commits[0].message , '[RELEASE]')
steps:
- uses: actions/checkout@v1
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: |
~/.npm
**/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/setup-node@v1
with:
node-version: 14
- name: Install Dependencies
run: npm install
- name: Run Lint
run: npm run lint --if-present
- name: Run Tests
run: npm test --if-present
- name: Install @gapi/cli globally
run: npm i -g @gapi/cli
- run: git config --global user.email '[email protected]'
- run: git config --global user.name "Kristiyan Tachev"
- run: npm config set '//registry.npmjs.org/:_authToken' "${{secrets.NPM_TOKEN}}"
- name: Build distribution
run: npm run build
- name: Patch version
run: npm version patch
- name: Publish version
run: npm publish --update-readme --access public --force
env:
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
- uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}