Skip to content

Commit 87b700c

Browse files
committed
simplified publishing workflow
1 parent d73e83f commit 87b700c

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

.github/workflows/publish.yml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ jobs:
1111
- uses: actions/checkout@v2
1212
- uses: actions/setup-node@v2
1313
with:
14-
node-version: 12
15-
registry-url: https://npm.pkg.github.com
14+
node-version: 14
15+
registry-url: "https://registry.npmjs.org"
1616
scope: "@${{github.repository_owner}}"
17+
- run: npm install
1718
- run: |
19+
npm config set @${{github.repository_owner}}:registry https://npm.pkg.github.com
1820
npm config set //npm.pkg.github.com/:_authToken=$NODE_AUTH_TOKEN
19-
npm install
20-
env:
21-
NODE_AUTH_TOKEN: ${{github.token}}
22-
- run: npm publish
21+
npm publish --access public
2322
env:
2423
NODE_AUTH_TOKEN: ${{secrets.PAT}}
2524
@@ -32,16 +31,12 @@ jobs:
3231
node-version: 14
3332
registry-url: "https://registry.npmjs.org"
3433
scope: "@${{github.repository_owner}}"
35-
- run: |
36-
npm config set //npm.pkg.github.com/:_authToken=$NODE_AUTH_TOKEN
37-
npm install
34+
- run: npm install
3835
env:
3936
NODE_AUTH_TOKEN: ${{github.token}}
4037
- run: |
38+
npm config set @${{github.repository_owner}}:registry https://registry.npmjs.org
4139
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
42-
declare temp_npmrc="/home/runner/work/stackexchange-global-types/stackexchange-global-types/.npmrc"
43-
truncate $temp_npmrc -s 0
44-
echo "@${{github.repository_owner}}:registry=https://registry.npmjs.org" >> $temp_npmrc
4540
npm publish --access public
4641
env:
47-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
42+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

.npmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"scripts": {
66
"test": "tsd",
77
"readme": "generate-readme",
8+
"preversion": "npm run test",
89
"postversion": "bash ./scripts/version.sh"
910
},
1011
"tsd": {

0 commit comments

Comments
 (0)