-
Notifications
You must be signed in to change notification settings - Fork 10
48 lines (45 loc) · 1.83 KB
/
PublishNpm.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
name: Publish npm packages
on:
push:
tags:
- "pluggable-widgets-tools-v*"
- "generator-widget-v*"
jobs:
publish:
name: "Publish NPM packages"
runs-on: ubuntu-latest
steps:
- name: "Checking-out code"
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2
with:
submodules: false
- name: "Defining Environment Variables"
id: variables
run: echo "::set-output name=tag::$(git tag --points-at HEAD)"
- name: "Defining node version"
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561 # v2
with:
node-version-file: ".nvmrc"
- name: "Installing root dependencies"
working-directory: ./
run: npm install
- name: "Installing pluggable-widgets-tools dependencies"
working-directory: ./packages/pluggable-widgets-tools
if: contains(steps.variables.outputs.tag, 'pluggable-widgets-tools-v')
run: npm install
- name: "Installing generator-widget dependencies"
working-directory: ./packages/generator-widget
if: contains(steps.variables.outputs.tag, 'generator-widget-v')
run: npm install
- name: "Targeting Pluggable Widgets Tools"
if: contains(steps.variables.outputs.tag, 'pluggable-widgets-tools-v')
uses: JS-DevTools/npm-publish@0f451a94170d1699fd50710966d48fb26194d939 # v1
with:
package: "./packages/pluggable-widgets-tools/package.json"
token: ${{ secrets.NPM_TOKEN }}
- name: "Targeting Pluggable Widgets Generator"
if: contains(steps.variables.outputs.tag, 'generator-widget-v')
uses: JS-DevTools/npm-publish@0f451a94170d1699fd50710966d48fb26194d939 # v1
with:
package: "./packages/generator-widget/package.json"
token: ${{ secrets.NPM_TOKEN }}