Skip to content

Commit 88d2f98

Browse files
committed
ci: add node auth token for publishing
1 parent 4e646ca commit 88d2f98

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

.github/workflows/CI.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ jobs:
3939
~/.pnpm-store
4040
D:\.pnpm-store
4141
./.dub
42-
~/llvm
4342
key: "cache-OS:${{ matrix.os }}-D:${{ matrix.d }}-CXX:${{ matrix.compiler }}-${{ hashFiles('./dub.selections.json', './pnpm-lock.yaml')}} }}"
4443
restore-keys: |
4544
"cache-OS:${{ matrix.os }}-D:${{ matrix.d }}-CXX:${{ matrix.compiler }}-"
@@ -71,7 +70,7 @@ jobs:
7170
node-version: ${{ matrix.node }}
7271

7372
- name: Setup Pnpm
74-
uses: pnpm/action-setup@v2
73+
uses: pnpm/action-setup@v4
7574
with:
7675
version: ${{ matrix.pnpm }}
7776

@@ -114,6 +113,7 @@ jobs:
114113
tar -czf ./dist/minijson-macos-x64.tar.gz -C ./dist/darwin-x64 minijson
115114
tar -czf ./dist/minijson-macos-arm64.tar.gz -C ./dist/darwin-arm64 minijson
116115
tar -czf ./dist/minijson-linux-x64.tar.gz -C ./dist/linux-x64 minijson
116+
ls -l ./dist
117117
118118
- name: Draft the release
119119
if: startsWith(github.ref, 'refs/tags/')
@@ -130,4 +130,6 @@ jobs:
130130
131131
- name: Publish to npm
132132
if: startsWith(github.ref, 'refs/tags/')
133-
run: pnpm publish --access public
133+
run: pnpm publish
134+
env:
135+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,15 @@
2424
"format": "prettier -l --cache --write . && pnpm run format.d",
2525
"format.d": "dub run --build=release --quiet dfmt -- --soft_max_line_length 110 --indent_size 2 --inplace ./src ./benchmark",
2626
"lint": "eslint . --fix",
27-
"prepublishOnly": "shx rm -rf ./dist/tsconfig.tsbuildinfo ./dist/*.zip ./dist/build.* && chmod +x ./dist/*/minijson",
27+
"prepublishOnly": "shx rm -rf ./dist/tsconfig.tsbuildinfo ./dist/*.zip ./dist/*.tar.* ./dist/build.* && chmod +x ./dist/*/minijson",
2828
"start.benchmark.js": "node ./benchmark/js-benchmark.mjs",
2929
"start.benchmark.node": "node ./benchmark/native-benchmark.mjs",
3030
"start.browser": "servor ./dist/ --browse --reload",
3131
"start.node": "node ./dist/node/cli.js",
3232
"start.profile": "shx rm -rf ./trace.* && pnpm run start.benchmark.node && profdump.exe --dot trace.log trace.dot && dot -Tsvg trace.dot -o trace.svg && ./trace.svg",
3333
"test": "pnpm run build.node && jasmine ./test/index-test.mjs",
3434
"test.format": "prettier -l --cache . --check",
35-
"test.lint": "eslint .",
36-
"zip": "zip -9 -j ./dist/minijson-windows-x64.zip ./dist/win32-x64/minijson.exe && zip -9 -j ./dist/minijson-macos-x64.zip ./dist/darwin-x64/minijson && zip -9 -j ./dist/minijson-macos-arm64.zip ./dist/darwin-arm64/minijson && zip -9 -j ./dist/minijson-linux-x64.zip ./dist/linux-x64/minijson "
35+
"test.lint": "eslint ."
3736
},
3837
"prettier": "prettier-config-atomic",
3938
"dependencies": {

0 commit comments

Comments
 (0)