-
Notifications
You must be signed in to change notification settings - Fork 3
57 lines (49 loc) · 1.48 KB
/
publish-theme.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
name: NPM Publish
on:
push:
tags:
- "v*"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
cache: yarn
- run: yarn install --frozen-lockfile
- name: Build
run: |
cp ./README_zh-CN.md ./packages/vitepress-theme-async
cp ./README.md ./packages/vitepress-theme-async
node ./scripts/publish.mjs
zip -r vitepress-theme-async ./packages/vitepress-theme-async
env:
RELEASE_VERSION: ${{ github.ref }}
- name: Beta Publish
if: ${{ contains(github.ref,'beta') }}
run: |
cd ./packages/vitepress-theme-async
npm publish --tag beta
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish
if: ${{ !contains(github.ref,'beta') }}
run: |
cd ./packages/vitepress-theme-async
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create Releases
uses: MaLuns/add-release@v1
with:
files: vitepress-theme-async.zip
generate_release_notes: true
generate_release_notes_by_commit: true
prerelease: ${{ contains(github.ref,'beta') }}