forked from node-red-contrib/node-red-contrib-mikrotik
-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (57 loc) · 1.65 KB
/
Copy pathpublish.yml
File metadata and controls
69 lines (57 loc) · 1.65 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Publish
on:
release:
types: [ published ]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: npm install & set Version
run: |
npm ci
npm config set git-tag-version false
npm version ${{ github.event.release.tag_name }}
- name: build & pack
run: |
npm run build --if-present
npm pack
- uses: JS-DevTools/npm-publish@v1
if: "!github.event.release.prerelease"
with:
token: ${{ secrets.NPM_TOKEN }}
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: '${{ github.event.release.upload_url }}'
asset_path: ./${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.tgz
asset_name: ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.tgz
asset_content_type: application/zip
- name: Update package.json for NameWith2
uses: jossef/action-set-json-field@v1
with:
file: package.json
field: name
value: ${{ github.event.repository.name }}2
- name: pack
run: |
cat package.json
npm pack
- name: Update package.json for NameWith3
uses: jossef/action-set-json-field@v1
with:
file: package.json
field: name
value: ${{ github.event.repository.name }}3
- name: pack
run: |
npm pack