diff --git a/.github/workflows/pre-publish.yml b/.github/workflows/pre-publish.yml index 15f8e65..19eb646 100644 --- a/.github/workflows/pre-publish.yml +++ b/.github/workflows/pre-publish.yml @@ -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: @@ -66,6 +60,7 @@ jobs: - rollup.config.js - tsconfig.json - .babelrc + - .github/workflow/publish.yml - name: Repository Dispatch if: steps.changes.outputs.update == 'true' diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1ed8969..2a2bdeb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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 @@ -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 @@ -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: @@ -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: |