Skip to content

Commit

Permalink
Fix: npm publishing (#848)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmercm authored Dec 3, 2023
1 parent 41005b5 commit 0cc9aec
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/node-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ on:
release:
types:
- published
workflow_dispatch:

jobs:
node-publish:
runs-on: ubuntu-latest
permissions:
# actions/checkout@v3
# actions/checkout@v4
contents: read
# `npm publish --provenance`
id-token: write
Expand All @@ -21,15 +22,15 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: volta-cli/action@v4
with:
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- id: publish
name: npm publish
# https://github.com/bitwarden/clients/pull/3272
run: |
echo 'registry="https://registry.npmjs.org/"' > ./.npmrc
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" >> ./.npmrc
npm publish --regsitry=https://registry.npmjs.org/ --userconfig=./.npmrc --provenance --access public
set -x
npm whoami
npm publish
{
echo "PACKAGE_NAME=$(jq --raw-output '.name' package.json)"
echo "PACKAGE_VERSION=$(jq --raw-output '.version' package.json)"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-renamer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ concurrency:
jobs:
rename:
permissions:
# actions/checkout@v3
# actions/checkout@v4
contents: read
# `gh` CLI
repository-projects: read
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
"type": "git",
"url": "git+https://github.com/emmercm/igir.git"
},
"publishConfig": {
"access": "public",
"provenance": true
},
"scripts": {
"cache:clear": "npm cache clean --force && node --experimental-vm-modules ./node_modules/jest/bin/jest.js --clearCache",
"postinstall": "node --eval \"if(require('fs').existsSync('dist')===false){process.exit(1);}\" || npm run build",
Expand Down

0 comments on commit 0cc9aec

Please sign in to comment.