Skip to content

Commit ac2a4aa

Browse files
fix: restore GitHub Packages publishing for @contentful packages
CI publish to GitHub Packages was silently failing because the project .npmrc (with @contentful:registry=https://registry.npmjs.org) overrides the CI-configured ~/.npmrc scope, causing lerna publish to target the wrong registry without auth. - Restore removal of project .npmrc during publish step (was in 4d728ad, mistakenly removed in b8576a9) - Remove silent error suppression on lerna publish from-git so publish failures are visible in CI - Add publishConfig to all publishable packages as defense-in-depth Made-with: Cursor
1 parent 0b55f21 commit ac2a4aa

File tree

5 files changed

+14
-1
lines changed

5 files changed

+14
-1
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ commands:
1313
- run:
1414
name: Setup GitHub packages
1515
command: |
16+
rm -f ./.npmrc
1617
echo "//npm.pkg.github.com/:_authToken=${GITHUB_PACKAGES_WRITE_TOKEN}" > ~/.npmrc
1718
echo "@contentful:registry=https://npm.pkg.github.com" >> ~/.npmrc
1819
- run:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"deploy": "lerna run deploy --concurrency=3 --since=${SINCE:-master}",
2626
"deploy:test": "lerna run deploy:test --concurrency=3 --since=${SINCE:-master}",
2727
"post-deploy": "lerna run post-deploy",
28-
"publish-packages": "lerna version --conventional-commits --no-private --force-git-tag --create-release github --yes && (lerna publish from-git --yes || echo 'Publish failed, continuing...')",
28+
"publish-packages": "lerna version --conventional-commits --no-private --force-git-tag --create-release github --yes && lerna publish from-git --yes",
2929
"prettier:list": "npx prettier@2.8.8 --list-different",
3030
"prettier:write": "npx prettier@2.8.8 --write",
3131
"prettier:check": "npx prettier@2.8.8 --check '**/*.{js,jsx,ts,tsx}'",

packages/dam-app-base/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
"url": "https://github.com/contentful/apps.git",
1515
"directory": "packages/dam-app-base"
1616
},
17+
"publishConfig": {
18+
"access": "public",
19+
"registry": "https://npm.pkg.github.com/"
20+
},
1721
"devDependencies": {
1822
"@testing-library/react": "16.3.0",
1923
"@types/jest": "27.5.0",

packages/ecommerce-app-base/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
"url": "https://github.com/contentful/apps.git",
1515
"directory": "packages/ecommerce-app-base"
1616
},
17+
"publishConfig": {
18+
"access": "public",
19+
"registry": "https://npm.pkg.github.com/"
20+
},
1721
"devDependencies": {
1822
"@babel/preset-env": "^7.22.10",
1923
"@babel/preset-react": "^7.22.5",

packages/eslint-plugin-contentful-apps/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
"url": "https://github.com/contentful/apps.git",
1717
"directory": "packages/eslint-plugin-contentful-apps"
1818
},
19+
"publishConfig": {
20+
"access": "public",
21+
"registry": "https://npm.pkg.github.com/"
22+
},
1923
"author": "Contentful GmbH",
2024
"license": "MIT",
2125
"description": "Eslint plugin for Contentful App Framework Apps",

0 commit comments

Comments
 (0)