-
Notifications
You must be signed in to change notification settings - Fork 108
65 lines (60 loc) · 2.12 KB
/
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
54
55
56
57
58
59
60
61
62
63
64
65
on:
push:
tags:
- "v*"
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: "https://registry.npmjs.org"
- name: Install dependencies and build 🔧
run: npm ci && npm run build
- name: Run lint
run: npm run lint
- name: Run tests
run: npm run test
- name: Package module
run: npm pack
- name: Verify tag version is the same as package.json version
id: version
run: |
[ ${GITHUB_REF:11} = $(node -p "require('./package.json').version") ]
echo "version=${GITHUB_REF:11}" >> $GITHUB_OUTPUT
- name: Upload package file
uses: actions/upload-artifact@v1
with:
name: esptool-js-${{ steps.version.outputs.version }}.tgz
path: esptool-js-${{ steps.version.outputs.version }}.tgz
- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Espressif ESPTOOL-JS ${{ github.ref }}
draft: true
body: |
### Release Highlights
### Features & Enhancements
<!-- Insert The Features and Enhancements below as points possibly add the link to the PR/commit -->
### Bug Fixes
<!-- Insert The Bug Fixes below as points, also add relevant links -->
- name: Upload release
id: upload-release-asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./esptool-js-${{ steps.version.outputs.version }}.tgz
asset_name: esptool-js-${{ steps.version.outputs.version }}.tgz
asset_content_type: application/zip
- name: Publish package on NPM 📦
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}