-
Notifications
You must be signed in to change notification settings - Fork 62
45 lines (41 loc) · 1.17 KB
/
publish_release.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 release
on:
page_build:
release:
types:
- published
jobs:
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
registry-url: https://registry.npmjs.org/
- run: yarn install --frozen-lockfile --ignore-scripts
- run: npm run publish:latest
if: '!github.event.release.prerelease'
env:
NODE_AUTH_TOKEN: ${{secrets.NPMJS_PUBLISH_TOKEN}}
- run: npm run publish:dist
if: 'github.event.release.prerelease'
env:
NODE_AUTH_TOKEN: ${{secrets.NPMJS_PUBLISH_TOKEN}}
- uses: vimtor/action-zip@v1
with:
files: dist/
dest: build.zip
- name: Upload Release Asset
id: 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: ./build.zip
asset_name: build.zip
asset_content_type: application/zip