Skip to content

Commit 86df469

Browse files
committed
(#285) Added additional publish step for GitHub package registry
1 parent d8b183d commit 86df469

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed

.build/pre-release.sh

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
#!/usr/bin/env bash
22
set -ex
33

4-
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
5-
npm whoami
6-
7-
npm ci
84
patchVersion=$(npm --no-git-tag version patch)
95
nextVersion=${patchVersion}-next."$(date +%Y%m%d%H%M%S)"
106
echo "${nextVersion:1}"
117

12-
npm version --no-git-tag -f "${nextVersion:1}"
13-
npm run publish-next
8+
npm version --no-git-tag -f "${nextVersion:1}"

.github/workflows/snapshot_release.yaml

+13-1
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,21 @@ jobs:
5858
uses: actions/setup-node@v2
5959
with:
6060
node-version: 14
61+
registry-url: 'https://registry.npmjs.org'
62+
- name: Install
63+
run: npm ci
6164
- name: Install @nut-tree/libnut@next
6265
run: npm i @nut-tree/libnut@next
6366
- name: Publish snapshot release
6467
run: bash ./.build/pre-release.sh
68+
- name: Publish tagged release to npm
69+
run: npm run publish-next
70+
env:
71+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
72+
- uses: actions/setup-node@v2
73+
with:
74+
registry-url: 'https://npm.pkg.github.com'
75+
- name: Publish tagged release to GPR
76+
run: npm run publish-next
6577
env:
66-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
78+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/tagged_release.yaml

+11-3
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ jobs:
5252
uses: actions/setup-node@v2
5353
with:
5454
node-version: 14
55+
registry-url: 'https://registry.npmjs.org'
5556
- name: Install
5657
run: npm ci
5758
- name: Run typedoc
@@ -62,7 +63,14 @@ jobs:
6263
deploy_key: ${{ secrets.API_DOC_DEPLOY_KEY }}
6364
external_repository: nut-tree/apidoc
6465
publish_dir: ./docs
65-
- name: Publish tagged release
66-
uses: JS-DevTools/npm-publish@v1
66+
- name: Publish tagged release to npm
67+
run: npm publish
68+
env:
69+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
70+
- uses: actions/setup-node@v2
6771
with:
68-
token: ${{ secrets.NPM_TOKEN }}
72+
registry-url: 'https://npm.pkg.github.com'
73+
- name: Publish tagged release to GPR
74+
run: npm publish
75+
env:
76+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)