File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : 发布 npm 公共包
1+ name : 发布主题包
22
33on :
44 release :
55 types : [published]
66 workflow_dispatch :
77
88permissions :
9- contents : read
9+ contents : write
1010
1111jobs :
1212 publish :
3838 working-directory : theme
3939 run : pnpm pack --dry-run
4040
41- - name : 发布包
41+ - name : 打包 Release 资产
42+ working-directory : theme
43+ run : |
44+ mkdir -p ../dist
45+ pnpm pack --pack-destination ../dist
46+ mv ../dist/doudou-start-airgate-theme-*.tgz "../dist/airgate-theme-${GITHUB_REF_NAME}.tgz"
47+
48+ - name : 上传 GitHub Release 资产
49+ if : github.event_name == 'release'
50+ env :
51+ GH_TOKEN : ${{ github.token }}
52+ run : gh release upload "${GITHUB_REF_NAME}" "dist/airgate-theme-${GITHUB_REF_NAME}.tgz" --clobber
53+
54+ - name : 发布 npm 包
4255 working-directory : theme
43- run : pnpm publish --access public --no-git-checks
4456 env :
4557 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
58+ run : |
59+ if [ -z "$NODE_AUTH_TOKEN" ]; then
60+ echo "NPM_TOKEN 未配置,跳过 npm publish"
61+ exit 0
62+ fi
63+ pnpm publish --access public --no-git-checks
You can’t perform that action at this time.
0 commit comments