Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .kokoro/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ npm test
# -----------------------------------------------------------------------------
# 4. Upload to Internal Exit Gate Artifact Registry
# -----------------------------------------------------------------------------
cd "${REPO_DIR}/util"

EXIT_GATE_PROJECT="oss-exit-gate-prod"
EXIT_GATE_LOCATION="us"
EXIT_GATE_REPOSITORY="measurement-devrel--npm"
Expand All @@ -54,21 +52,23 @@ else
echo "=== Skipping deletion. Package '${PACKAGE_NAME}' not found in staging repository. 🙂 ==="
fi

# Configure .npmrc for Artifact Registry according to go/oss-exit-gate-release-npm
# Configure .npmrc for Artifact Registry according to go/oss-exit-gate-release-npm.
# Because this project uses npm workspaces, npm ignores .npmrc files inside
# workspace subdirectories (e.g. util/.npmrc). Writing to repository root ensures
# npm resolves the registry and credentials properly across all workspace packages.
cat <<EOF > .npmrc
@google-ads:registry=https://${EXIT_GATE_LOCATION}-npm.pkg.dev/${EXIT_GATE_PROJECT}/${EXIT_GATE_REPOSITORY}/
//${EXIT_GATE_LOCATION}-npm.pkg.dev/${EXIT_GATE_PROJECT}/${EXIT_GATE_REPOSITORY}/:always-auth=true
EOF
# Clean up .npmrc and manifest.json on exit. google-artifactregistry-auth writes
# a live GCP OAuth bearer token into .npmrc, so removing it prevents credential
# leakage into Kokoro logs/artifacts and keeps the local workspace clean.
trap 'rm -f .npmrc manifest.json 2>/dev/null || true' EXIT
# Clean up .npmrc on exit. google-artifactregistry-auth writes a live GCP OAuth
# bearer token into .npmrc, so removing it prevents credential leakage.
trap "rm -f '${REPO_DIR}/.npmrc' 2>/dev/null || true" EXIT

# Authenticate with Artifact Registry
npx google-artifactregistry-auth

echo "=== Publishing package to Exit Gate staging repository ==="
npm publish
npm publish --workspace util

# -----------------------------------------------------------------------------
# 5. Trigger Exit Gate Release via GCS Manifest
Expand Down Expand Up @@ -98,7 +98,7 @@ cat <<EOF > manifest.json
EOF

EXIT_GATE_BUCKET="gs://oss-exit-gate-prod-projects-bucket/measurement-devrel/npm/manifests"
MANIFEST_NAME="manifest-$(date +%Y%m%d%H%M%S).json"
MANIFEST_NAME="manifest-$(date --utc +%Y%m%d%H%M%S'UTC').json"

echo "=== Uploading manifest to ${EXIT_GATE_BUCKET}/${MANIFEST_NAME} ==="
gcloud storage cp manifest.json "${EXIT_GATE_BUCKET}/${MANIFEST_NAME}"
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion samples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"dependencies": {
"@google-ads/datamanager": "^1.0.0",
"@google-ads/data-manager-util": "^0.4.0-rc1",
"@google-ads/data-manager-util": "^0.4.0",
"csv-parser": "^3.0.0",
"yargs": "^17.7.2"
},
Expand Down
2 changes: 1 addition & 1 deletion util/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@google-ads/data-manager-util",
"version": "0.4.0-rc1",
"version": "0.4.0",
"description": "A utility library for the Data Manager API for Node.js.",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
Expand Down
Loading