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",