diff --git a/.circleci/config.yml b/.circleci/config.yml index a8522d1ad..e8b002718 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -353,17 +353,15 @@ jobs: echo "Not a PR; skipping" fi - run: - name: Setup registry config for using package previews on draft PRs + name: Install dependencies command: | if [[ $IS_DRAFT == 'true' ]] then - printf '%s\n\n%s' '@metamask:registry=https://npm.pkg.github.com' "//npm.pkg.github.com/:_authToken=${GITHUB_PACKAGE_READ_TOKEN}" > .npmrc + # Use GitHub registry on draft PRs, allowing the use of preview builds + METAMASK_NPM_REGISTRY=https://npm.pkg.github.com yarn --immutable else - echo "Not draft; skipping GitHub registry setup" + yarn --immutable fi - - run: - name: Install deps - command: yarn --immutable - save_cache: key: dependency-cache-v1-{{ checksum "yarn.lock" }} paths: diff --git a/.yarnrc.yml b/.yarnrc.yml index 5d351f8e2..03fa25aa0 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -8,6 +8,15 @@ logFilters: nodeLinker: node-modules +npmRegistries: + "https://npm.pkg.github.com": + npmAlwaysAuth: true + npmAuthToken: "${GITHUB_PACKAGE_READ_TOKEN-}" + +npmScopes: + metamask: + npmRegistryServer: "${METAMASK_NPM_REGISTRY:-https://registry.yarnpkg.com}" + plugins: - path: .yarn/plugins/@yarnpkg/plugin-allow-scripts.cjs spec: "https://raw.githubusercontent.com/LavaMoat/LavaMoat/main/packages/yarn-plugin-allow-scripts/bundles/@yarnpkg/plugin-allow-scripts.js"