diff --git a/.build/pre-release.sh b/.build/pre-release.sh index fe44496a..1f515ee3 100644 --- a/.build/pre-release.sh +++ b/.build/pre-release.sh @@ -1,13 +1,8 @@ #!/usr/bin/env bash set -ex -echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc -npm whoami - -npm ci patchVersion=$(npm --no-git-tag version patch) nextVersion=${patchVersion}-next."$(date +%Y%m%d%H%M%S)" echo "${nextVersion:1}" -npm version --no-git-tag -f "${nextVersion:1}" -npm run publish-next \ No newline at end of file +npm version --no-git-tag -f "${nextVersion:1}" \ No newline at end of file diff --git a/.github/workflows/snapshot_release.yaml b/.github/workflows/snapshot_release.yaml index e7dd13dc..1aca1b22 100644 --- a/.github/workflows/snapshot_release.yaml +++ b/.github/workflows/snapshot_release.yaml @@ -58,9 +58,21 @@ jobs: uses: actions/setup-node@v2 with: node-version: 14 + registry-url: 'https://registry.npmjs.org' + - name: Install + run: npm ci - name: Install @nut-tree/libnut@next run: npm i @nut-tree/libnut@next - name: Publish snapshot release run: bash ./.build/pre-release.sh + - name: Publish tagged release to npm + run: npm run publish-next + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - uses: actions/setup-node@v2 + with: + registry-url: 'https://npm.pkg.github.com' + - name: Publish tagged release to GPR + run: npm run publish-next env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/tagged_release.yaml b/.github/workflows/tagged_release.yaml index 2dfc280f..8b94df45 100644 --- a/.github/workflows/tagged_release.yaml +++ b/.github/workflows/tagged_release.yaml @@ -52,6 +52,7 @@ jobs: uses: actions/setup-node@v2 with: node-version: 14 + registry-url: 'https://registry.npmjs.org' - name: Install run: npm ci - name: Run typedoc @@ -62,7 +63,14 @@ jobs: deploy_key: ${{ secrets.API_DOC_DEPLOY_KEY }} external_repository: nut-tree/apidoc publish_dir: ./docs - - name: Publish tagged release - uses: JS-DevTools/npm-publish@v1 + - name: Publish tagged release to npm + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - uses: actions/setup-node@v2 with: - token: ${{ secrets.NPM_TOKEN }} + registry-url: 'https://npm.pkg.github.com' + - name: Publish tagged release to GPR + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file