-
-
Notifications
You must be signed in to change notification settings - Fork 7
45 lines (45 loc) · 1.28 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
name: publish
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm run compile
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- name: Pack tarball
id: pack_tarball
run: |
PACK_NAME=$(npm pack | tail -n 1)
echo "::set-output name=tar_filename::$PACK_NAME"
- name: Upload
uses: actions/upload-artifact@v2
with:
name: package
path: "*.tgz"
- name: Get release
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload asset to github release page
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./${{ steps.pack_tarball.outputs.tar_filename }}
asset_name: ${{ steps.pack_tarball.outputs.tar_filename }}
asset_content_type: application/gzip