Skip to content

Commit

Permalink
feat(ci): refine ci yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
hankliu62 committed Apr 22, 2024
1 parent c1db886 commit 216e5b2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/component-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,19 @@ jobs:
path: node_modules
key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }}

# 判断是否需要发布
- name: 从 package.json 是否需要发布
id: version
run: echo "PUBLISHED=$(node -p 'require(`./package.json`).version')" >> $GITHUB_ENV

# 打包
- name: 打包 🏗️
if: ${{ env.PUBLISHED }} == 'true'
run: npm run compile

- name: 从 package.json 是否需要发布
id: version
run: echo "PUBLISHED=$(node -p 'require(`./package.json`).version')" >> $GITHUB_ENV
# 发布
- name: 发布 🚀
if: ${{ env.VERSION }} == 'true'
if: ${{ env.PUBLISHED }} == 'true'
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down

0 comments on commit 216e5b2

Please sign in to comment.