Skip to content

Commit

Permalink
更新action
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanfeijie committed Apr 23, 2024
1 parent 293a3fa commit 0af851b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/pre-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

- name: Package specific files
run: |
# 指定打包的文件和文件夹
# 假设我们想要打包 package.json, dist 文件夹以及 LICENSE 文件
zip -r my-archive.zip ./package.json ./dist ./LICENSE
ls -al
- uses: dorny/paths-filter@v3
id: changes
with:
Expand All @@ -66,6 +60,7 @@ jobs:
- rollup.config.js
- tsconfig.json
- .babelrc
- .github/workflow/publish.yml
- name: Repository Dispatch
if: steps.changes.outputs.update == 'true'
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
echo "TAG_NAME=$TAG_NAME"
# 将组合的TAG_NAME输出到环境变量
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
- name: Install pnpm
run: |
npm install -g pnpm
Expand All @@ -61,7 +61,7 @@ jobs:
run: |
git pull -p
pnpm run build
- name: Add Npm Token
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ./.npmrc
Expand All @@ -73,6 +73,13 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

- name: Package specific files
run: |
# 指定打包的文件和文件夹
# 假设我们想要打包 package.json, dist 文件夹以及 LICENSE 文件
zip -r ${{ env.TAG_NAME }}.zip ./package.json ./dist ./LICENSE
ls -al
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
env:
Expand All @@ -84,10 +91,7 @@ jobs:
body: "Check the changelog for details."
draft: false
prerelease: false
files: |
- package.json
- dist
- LICENSE
files: ${{ env.TAG_NAME }}.zip

- name: Commit and push Version
run: |
Expand Down

0 comments on commit 0af851b

Please sign in to comment.