Skip to content

Commit ccaf861

Browse files
authored
ci: fix gemfury push for Node.js packages (#4097)
Fixed `ENEEDAUTH` when publishing npm packages to Gemfury. The root cause is the script not accounting for NPM_REGISTRY URL having a trailing slash, causing a double-slash in the generated `.npmrc` key (`npm.fury.io/arrow-adbc-nightlies//:_authToken`) **Test Plan** Tested full gemfury package upload on my fork - Pointed URL's to my own gemfury - https://github.com/kentkwu/arrow-adbc/actions/runs/23171042963/job/67325129419 Closes #4093.
1 parent b28821e commit ccaf861

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

ci/scripts/node_npm_upload.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ main() {
3232
local packages_dir
3333
packages_dir="$(realpath "$1")"
3434
local registry="${NPM_REGISTRY:-https://registry.npmjs.org}"
35+
local registry_key="${registry%/}" # strip trailing slash for .npmrc key construction
3536
local dry_run_flag=""
3637
if [[ "${DRY_RUN:-0}" == "1" ]]; then
3738
dry_run_flag="--dry-run"
@@ -41,22 +42,26 @@ main() {
4142
tag_flag="--tag ${NPM_TAG}"
4243
fi
4344

45+
if [[ -z "${NPM_TOKEN:-}" ]]; then
46+
echo "Error: NPM_TOKEN is required" >&2
47+
exit 1
48+
fi
49+
4450
# Write a temp .npmrc with the auth token for the target registry
4551
local npmrc
4652
npmrc=$(mktemp)
4753
trap "rm -f ${npmrc}" EXIT
48-
echo "//${registry#*://}/:_authToken=${NPM_TOKEN:-}" > "${npmrc}"
49-
export NPM_CONFIG_USERCONFIG="${npmrc}"
54+
echo "//${registry_key#*://}/:_authToken=${NPM_TOKEN}" > "${npmrc}"
5055

5156
# Publish platform-specific packages first, then the main package
5257
for pkg in "${packages_dir}"/apache-arrow-adbc-driver-manager-*-*.tgz; do
5358
echo "==== Publishing ${pkg}"
54-
npm publish "${pkg}" --access public --registry "${registry}" ${tag_flag} ${dry_run_flag}
59+
npm publish "${pkg}" --access public --registry "${registry}" --userconfig "${npmrc}" ${tag_flag} ${dry_run_flag}
5560
done
5661

5762
echo "==== Publishing main package"
5863
npm publish "${packages_dir}"/apache-arrow-adbc-driver-manager-[0-9]*.tgz \
59-
--access public --registry "${registry}" ${tag_flag} ${dry_run_flag}
64+
--access public --registry "${registry}" --userconfig "${npmrc}" ${tag_flag} ${dry_run_flag}
6065
}
6166

6267
main "$@"

javascript/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ support browser or Deno environments. Bun is not officially tested.
2929
## Installation
3030

3131
```bash
32-
npm install adbc-driver-manager apache-arrow
32+
npm install @apache-arrow/adbc-driver-manager apache-arrow
3333
```
3434

3535
## Usage
@@ -39,7 +39,7 @@ name. When using a short name, the driver manager searches system and user
3939
paths for a matching ADBC driver manifest or library.
4040

4141
```typescript
42-
import { AdbcDatabase } from 'adbc-driver-manager'
42+
import { AdbcDatabase } from '@apache-arrow/adbc-driver-manager'
4343

4444
// Short name (resolves from system/user paths)
4545
const db = new AdbcDatabase({ driver: 'sqlite' })

0 commit comments

Comments
 (0)