From 37ccbc10c8725c01c22cf4fc907723677ed620c7 Mon Sep 17 00:00:00 2001 From: cmm-va <867884660@qq.com> Date: Wed, 10 May 2023 19:22:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=96=B0=E5=A2=9E=E5=8F=91=E5=B8=83=20n?= =?UTF-8?q?ext=20=E5=91=BD=E4=BB=A4=EF=BC=8C=E4=BD=BF=E7=94=A8wpm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/publish.yml | 12 +++--------- .wpmrc.js | 12 ++++++++++++ package.json | 9 +++++++-- 3 files changed, 22 insertions(+), 11 deletions(-) create mode 100644 .wpmrc.js diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f6d441e2..fc965592 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -32,10 +32,6 @@ jobs: uses: actions/checkout@v3 with: ref: ${{ github.head_ref }} - - name: Authenticate - run: | - echo "//npm.pkg.github.com/:_authToken=${{ secrets.PUBLISH_PACKAGE_TOKEN }}" > ~/.npmrc - echo "@atinc:registry=https://npm.pkg.github.com/" >> ~/.npmrc - name: Setup Node.js uses: actions/setup-node@v3 with: @@ -49,17 +45,15 @@ jobs: git config user.email github-actions@github.com npm run pub env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Publish-next if: startsWith(github.head_ref, 'release-auto-next-v') run: | git config user.name github-actions - git config user.email github-actions@github.com + git config user.email github-actions@github.com npm run pub-next env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Unset authenticate - run: rm ~/.npmrc + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Read package.json id: read-version uses: notiz-dev/github-action-json-property@release diff --git a/.wpmrc.js b/.wpmrc.js new file mode 100644 index 00000000..8aa50158 --- /dev/null +++ b/.wpmrc.js @@ -0,0 +1,12 @@ +module.exports = { + allowBranch: ['master', 'release-auto-*'], + bumpFiles: ['package.json', 'package-lock.json', 'packages/gantt/package.json'], + skip: { + confirm: true + }, + tagPrefix: '', + hooks: { + prepublish: 'npm run build', + postpublish: 'npm run pub-only' + } +}; diff --git a/package.json b/package.json index c3bdb010..e6a1ad8c 100644 --- a/package.json +++ b/package.json @@ -20,9 +20,13 @@ "build:styles": "cpx \"./packages/gantt/src/**/*.scss\" dist/gantt", "test": "ng test", "lint": "ng lint", - "release": "standard-version", + "release": "wpm release --release-branch-format release-auto-v{{version}}", + "release-next": "wpm release --release-branch-format release-auto-next-v{{version}}", "pub-only": "cd dist/gantt && npm publish --access=public", - "pub": "npm run build && npm run pub-only", + "pub": "wpm publish && npm run pub-only", + "pub-next": "wpm publish && npm run pub-next-only", + "pub-next-only": "npm run pub-next-gantt-only", + "pub-next-gantt-only": "cd ./dist/gantt && npm publish --tag next", "report-coverage": "cat ./coverage/gantt/lcov.info | coveralls", "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s --pkg ./packages/gantt/package.json", "contributors:init": "all-contributors init", @@ -40,6 +44,7 @@ "@angular/platform-browser": "^15.0.4", "@angular/platform-browser-dynamic": "^15.0.4", "@angular/router": "^15.0.4", + "@worktile/pkg-manager": "^0.0.11", "cpx": "^1.5.0", "date-fns": "^2.14.0", "html2canvas": "1.0.0-rc.7",