-
Notifications
You must be signed in to change notification settings - Fork 2
53 lines (48 loc) · 1.41 KB
/
build-and-publish.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
name: Build and Publish
on:
push:
branches:
- master
jobs:
build-lib:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node-version: [16.x]
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.TYK_UI_TOKEN }}
- name: Use node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: |
npm config set //registry.npmjs.org/:_authToken "${{ secrets.NPM_TOKEN }}" && npm ci
- name: Run production build
run: |
npm run build-prod
- name: Generate package-lock.json
run: |
npm i --package-lock-only
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@master
- name: Push changes
run: |
git config --local user.email "tyk-ui-bot@tyk.io"
git config --local user.name "tyk-ui bot"
git add .
git commit -m "Update lib to version ${{ steps.package-version.outputs.current-version}}"
git push
- name: Publish lib to npm
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_PUBLISH_TOKEN }}
env:
CI: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}