Skip to content

Commit e0b0fcc

Browse files
authored
Chore/release packages (#1203)
* chore: update npm publishing workflow and package metadata - Added `id-token` permission for OIDC support in GitHub Actions. - Updated npm to the latest version and verified the installation in the release workflow. - Changed package metadata URLs for all SDK packages to point to the new repository location. - Updated the repository URL in the root package.json for consistency. * chore(packages): add release changeset - add release changeset * chore(changeset): add release changeset
1 parent 4372f05 commit e0b0fcc

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

.changeset/gentle-zoos-juggle.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@commercetools/checkout-sdk': minor
3+
'@commercetools/history-sdk': minor
4+
'@commercetools/importapi-sdk': minor
5+
'@commercetools/platform-sdk': minor
6+
'@commercetools/sdk-client-v2': minor
7+
'@commercetools/ts-client': minor
8+
'@commercetools/ts-sdk-apm': minor
9+
---
10+
11+
release packages

.changeset/strong-suns-cover.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@commercetools/ts-client': patch
3+
'@commercetools/checkout-sdk': patch
4+
'@commercetools/platform-sdk': patch
5+
'@commercetools/history-sdk': patch
6+
'@commercetools/sdk-client-v2': patch
7+
'@commercetools/ts-sdk-apm': patch
8+
---
9+
10+
release changeset

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,47 @@ jobs:
4949
- name: Verify npm version
5050
run: npm --version
5151

52+
# Configure npm for OIDC authentication with trusted publishing
53+
# This must be done after CI setup to ensure npm is properly configured
54+
5255
- name: Setup Node.js for npm publishing
5356
uses: actions/setup-node@v4
5457
with:
5558
node-version: '22'
5659
registry-url: 'https://registry.npmjs.org'
5760

61+
- name: Configure npm for OIDC
62+
run: |
63+
# Ensure npm is configured to use the correct registry
64+
npm config set registry https://registry.npmjs.org/
65+
# Remove any existing auth token configuration that might interfere with OIDC
66+
npm config delete //registry.npmjs.org/:_authToken || true
67+
# Remove any user-level .npmrc that might have tokens
68+
if [ -f "$HOME/.npmrc" ]; then
69+
# Backup and clean .npmrc, keeping only non-auth config
70+
sed -i.bak '/_authToken/d' "$HOME/.npmrc" || true
71+
sed -i.bak '/_auth=/d' "$HOME/.npmrc" || true
72+
fi
73+
# Verify configuration
74+
echo "Registry: $(npm config get registry)"
75+
echo "npm OIDC will be used automatically during publish"
76+
# Show npm config (without sensitive data)
77+
npm config list
78+
5879
- name: Building packages
5980
run: yarn build
6081

82+
- name: Ensure .npmrc is configured for OIDC before changesets
83+
run: |
84+
# Create/update .npmrc to ensure OIDC is used
85+
# setup-node should have already configured this, but we ensure it's correct
86+
if [ -f "$HOME/.npmrc" ]; then
87+
echo "Current .npmrc content:"
88+
cat "$HOME/.npmrc" | grep -v "authToken" | grep -v "_auth" || true
89+
fi
90+
# Ensure registry is set
91+
npm config set registry https://registry.npmjs.org/
92+
6193
- name: Create Release Pull Request or Publish to npm
6294
id: changesets
6395
uses: changesets/action@v1
@@ -67,6 +99,8 @@ jobs:
6799
commit: 'ci(changesets): version packages'
68100
env:
69101
GITHUB_TOKEN: ${{ steps.generate_github_token.outputs.token }}
102+
# Ensure npm uses OIDC authentication
103+
NPM_CONFIG_REGISTRY: 'https://registry.npmjs.org'
70104

71105
- name: Dispatch repository event
72106
if: steps.changesets.outputs.published == 'true'

0 commit comments

Comments
 (0)