From 7e1141aa82f2870f150b302ac431f00e30b35357 Mon Sep 17 00:00:00 2001 From: adhil72 <126852465+adhil72@users.noreply.github.com> Date: Wed, 11 Nov 2026 20:17:21 +0530 Subject: [PATCH 1/2] chore(node): publish @adhil72/gitvault to the public npm registry Move the Node library from GitHub Packages to registry.npmjs.org with public access, so it installs without a GitHub token. The release publish step now authenticates with an NPM_TOKEN secret. Co-Authored-By: Claude Haiku 5.5 --- .github/workflows/release.yml | 6 +++--- packages/node/README.md | 8 +------- packages/node/package.json | 3 ++- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6fdf077..e171336 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -203,7 +203,7 @@ jobs: RELEASE_ID: ${{ needs.create-release.outputs.release_id }} run: gh api --method PATCH "repos/$GITHUB_REPOSITORY/releases/$RELEASE_ID" -F draft=false > /dev/null - # The Node library goes to GitHub Packages. It needs only the checkout, not the desktop builds. + # The Node library goes to the public npm registry. It needs only the checkout, not the desktop builds. publish-npm: needs: prepare if: needs.prepare.outputs.release == 'true' @@ -219,7 +219,7 @@ jobs: with: node-version: 22 cache: pnpm - registry-url: https://npm.pkg.github.com + registry-url: https://registry.npmjs.org - run: pnpm install --frozen-lockfile - name: Check the tag matches the package version run: | @@ -230,7 +230,7 @@ jobs: - name: Publish working-directory: packages/node env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} run: | if npm view "@adhil72/gitvault@${TAG#v}" version >/dev/null 2>&1; then echo "already published" diff --git a/packages/node/README.md b/packages/node/README.md index 7e9a5b5..08917fa 100644 --- a/packages/node/README.md +++ b/packages/node/README.md @@ -6,13 +6,7 @@ Load your GitVault secrets into `process.env` at startup. No `.env` files in the ## Install -Published on GitHub Packages. Point the scope at it and sign in with a token that has `read:packages` (and access to the repo): - -```ini -# .npmrc -@adhil72:registry=https://npm.pkg.github.com -//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN} -``` +Published on the public npm registry. No token needed: ```bash npm install @adhil72/gitvault diff --git a/packages/node/package.json b/packages/node/package.json index cfd25ca..b7f288e 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -46,6 +46,7 @@ "directory": "packages/node" }, "publishConfig": { - "registry": "https://npm.pkg.github.com" + "access": "public", + "registry": "https://registry.npmjs.org" } } From 68958009377ccf0b3525c3cad39d862809c6d87f Mon Sep 17 00:00:00 2001 From: adhil72 <126852465+adhil72@users.noreply.github.com> Date: Wed, 11 Nov 2026 20:20:06 +0530 Subject: [PATCH 2/2] ci(release): attach the Node library tarball to the public release publish-npm now waits for the desktop publish job, then packs the library and uploads the tarball and its SHA256 to the public website release, the same way the desktop builds are published. Co-Authored-By: Claude Haiku 5.5 --- .github/workflows/release.yml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e171336..cfda70c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -205,11 +205,12 @@ jobs: # The Node library goes to the public npm registry. It needs only the checkout, not the desktop builds. publish-npm: - needs: prepare + needs: [prepare, publish] if: needs.prepare.outputs.release == 'true' runs-on: ubuntu-latest env: TAG: ${{ needs.prepare.outputs.tag }} + PUBLIC_REPO: adhil72/gitvault-website steps: - uses: actions/checkout@v4 with: @@ -237,3 +238,22 @@ jobs: else npm publish fi + # Mirror the library next to the desktop builds in the public repository, + # as a downloadable tarball with its checksum. Needs the release that the + # publish job creates, so this job waits for it. + - name: Attach the library tarball to the public release + working-directory: packages/node + env: + GH_TOKEN: ${{ secrets.WEBSITE_TOKEN }} + run: | + if [ -z "$GH_TOKEN" ]; then + echo "::warning::WEBSITE_TOKEN is not set; the library tarball was not sent to $PUBLIC_REPO" + exit 0 + fi + version="${TAG#v}" + tgz=$(npm pack --silent) + cp "$tgz" "gitvault-node-$version.tgz" + sha256sum "gitvault-node-$version.tgz" > gitvault-node-SHA256SUMS + cat gitvault-node-SHA256SUMS + gh release upload "$TAG" --repo "$PUBLIC_REPO" --clobber \ + "gitvault-node-$version.tgz" gitvault-node-SHA256SUMS