Skip to content

Commit e13151c

Browse files
committed
ci: inject secrets to npmrc on publish
1 parent 427d79c commit e13151c

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

.github/workflows/dev-publish.yaml

+13-5
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,19 @@ jobs:
1212
- uses: actions/checkout@v4
1313
- uses: actions/setup-node@v4
1414
with:
15-
node-version: 20
15+
node-version: 22
1616
registry-url: 'https://registry.npmjs.org'
17-
- run: npm i
18-
- run: npm run build
19-
- run: npm version $(node --eval="process.stdout.write(require('./package.json').version)")-dev.$(git rev-parse --short HEAD) --no-git-tag-version
20-
- run: npm publish --no-git-tag-version --tag dev
17+
18+
- name: install
19+
run: npm i
20+
21+
- name: build
22+
run: npm run build
23+
24+
- name: publish
25+
- run: |
26+
echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" >> .npmrc
27+
npm version $(node --eval="process.stdout.write(require('./package.json').version)")-dev.$(git rev-parse --short HEAD) --no-git-tag-version
28+
npm publish --provenance --access=public --no-git-tag-version --tag dev
2129
env:
2230
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,11 @@ node_modules/
33
coverage/
44
yarn.lock
55
src/playground.ts
6+
7+
# Credentials
8+
**/*.asc
9+
**/*.key
10+
**/*.pem
11+
**/*.cert
12+
**/.npmrc
13+
**/.yarnrc

0 commit comments

Comments
 (0)