Skip to content

Commit 0cc8bcb

Browse files
committed
testing for npm trusted publishing; live
1 parent da9ba81 commit 0cc8bcb

File tree

5 files changed

+67
-48
lines changed

5 files changed

+67
-48
lines changed

.github/workflows/publish.yml

Lines changed: 47 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,15 @@ jobs:
6767
cache: 'pnpm'
6868
registry-url: 'https://registry.npmjs.org'
6969

70+
- name: Upgrade npm for trusted publishing
71+
run: npm install -g npm@latest
72+
7073
- name: Install dependencies
7174
run: pnpm install --frozen-lockfile
7275

73-
- name: Create snapshot versions
74-
if: steps.release-type.outputs.type == 'nightly'
75-
run: pnpm changeset version --snapshot nightly
76+
# - name: Create snapshot versions
77+
# if: steps.release-type.outputs.type == 'nightly'
78+
# run: pnpm changeset version --snapshot nightly
7679

7780
- name: Build packages
7881
run: pnpm run build
@@ -82,45 +85,45 @@ jobs:
8285

8386
- name: Publish to npm
8487
run: |
85-
pnpm --filter @salesforce/b2c-tooling-sdk publish --access public --no-git-checks --tag ${{ steps.release-type.outputs.tag }}
86-
pnpm --filter @salesforce/b2c-cli publish --access public --no-git-checks --tag ${{ steps.release-type.outputs.tag }}
87-
pnpm --filter @salesforce/b2c-dx-mcp publish --access public --no-git-checks --tag ${{ steps.release-type.outputs.tag }}
88-
89-
- name: Extract changelog for release
90-
if: steps.release-type.outputs.type == 'stable'
91-
run: |
92-
VERSION="${GITHUB_REF_NAME#v}"
93-
94-
# Function to extract version section from a changelog
95-
extract_version() {
96-
awk -v ver="$1" '
97-
/^## / { if (found) exit; if ($2 == ver) found=1; next }
98-
found { print }
99-
' "$2"
100-
}
88+
cd packages/b2c-tooling-sdk && npm publish --provenance --tag ${{ steps.release-type.outputs.tag }}
89+
# cd packages/b2c-cli && npm publish --provenance --tag ${{ steps.release-type.outputs.tag }}
90+
# cd packages/b2c-dx-mcp && npm publish --provenance --tag ${{ steps.release-type.outputs.tag }}
10191
102-
# Build combined release notes
103-
{
104-
echo "## @salesforce/b2c-cli"
105-
echo ""
106-
extract_version "$VERSION" packages/b2c-cli/CHANGELOG.md
107-
echo ""
108-
echo "## @salesforce/b2c-dx-mcp"
109-
echo ""
110-
extract_version "$VERSION" packages/b2c-dx-mcp/CHANGELOG.md
111-
echo ""
112-
echo "## @salesforce/b2c-tooling-sdk"
113-
echo ""
114-
extract_version "$VERSION" packages/b2c-tooling-sdk/CHANGELOG.md
115-
} > /tmp/release-notes.md
116-
117-
- name: Create GitHub Release
118-
if: steps.release-type.outputs.type == 'stable'
119-
run: |
120-
PRERELEASE_FLAG=""
121-
if [[ "${{ steps.release-type.outputs.prerelease }}" == "true" ]]; then
122-
PRERELEASE_FLAG="--prerelease"
123-
fi
124-
gh release create "$GITHUB_REF_NAME" --notes-file /tmp/release-notes.md $PRERELEASE_FLAG
125-
env:
126-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92+
# - name: Extract changelog for release
93+
# if: steps.release-type.outputs.type == 'stable'
94+
# run: |
95+
# VERSION="${GITHUB_REF_NAME#v}"
96+
#
97+
# # Function to extract version section from a changelog
98+
# extract_version() {
99+
# awk -v ver="$1" '
100+
# /^## / { if (found) exit; if ($2 == ver) found=1; next }
101+
# found { print }
102+
# ' "$2"
103+
# }
104+
#
105+
# # Build combined release notes
106+
# {
107+
# echo "## @salesforce/b2c-cli"
108+
# echo ""
109+
# extract_version "$VERSION" packages/b2c-cli/CHANGELOG.md
110+
# echo ""
111+
# echo "## @salesforce/b2c-dx-mcp"
112+
# echo ""
113+
# extract_version "$VERSION" packages/b2c-dx-mcp/CHANGELOG.md
114+
# echo ""
115+
# echo "## @salesforce/b2c-tooling-sdk"
116+
# echo ""
117+
# extract_version "$VERSION" packages/b2c-tooling-sdk/CHANGELOG.md
118+
# } > /tmp/release-notes.md
119+
#
120+
# - name: Create GitHub Release
121+
# if: steps.release-type.outputs.type == 'stable'
122+
# run: |
123+
# PRERELEASE_FLAG=""
124+
# if [[ "${{ steps.release-type.outputs.prerelease }}" == "true" ]]; then
125+
# PRERELEASE_FLAG="--prerelease"
126+
# fi
127+
# gh release create "$GITHUB_REF_NAME" --notes-file /tmp/release-notes.md $PRERELEASE_FLAG
128+
# env:
129+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

packages/b2c-cli/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
{
22
"name": "@salesforce/b2c-cli",
33
"description": "A Salesforce Commerce Cloud B2C CLI",
4-
"version": "0.0.1-preview",
4+
"version": "0.0.2",
55
"author": "Charles Lavery",
66
"bin": {
77
"b2c": "./bin/run.js"
88
},
99
"bugs": "https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/issues",
10+
"publishConfig": {
11+
"access": "public",
12+
"registry": "https://registry.npmjs.org/"
13+
},
1014
"dependencies": {
1115
"@oclif/core": "^4",
1216
"@oclif/plugin-autocomplete": "^3",

packages/b2c-dx-mcp/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@salesforce/b2c-dx-mcp",
3-
"version": "0.0.1-preview",
3+
"version": "0.0.2",
44
"description": "MCP server for B2C Commerce Cloud developer experience tools",
55
"author": "Salesforce",
66
"license": "MIT",
@@ -14,6 +14,10 @@
1414
"tooling"
1515
],
1616
"type": "module",
17+
"publishConfig": {
18+
"access": "public",
19+
"registry": "https://registry.npmjs.org/"
20+
},
1721
"main": "dist/commands/mcp.js",
1822
"types": "dist/commands/mcp.d.ts",
1923
"bin": {

packages/b2c-plugin-example-config/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
{
22
"name": "@salesforce/b2c-plugin-example-config",
3-
"version": "0.0.1-preview",
3+
"version": "0.0.2",
44
"description": "Example plugin demonstrating custom config source for B2C CLI",
55
"author": "Salesforce Commerce Cloud",
66
"license": "Apache-2.0",
77
"type": "module",
8+
"publishConfig": {
9+
"access": "public",
10+
"registry": "https://registry.npmjs.org/"
11+
},
812
"main": "dist/index.js",
913
"types": "dist/index.d.ts",
1014
"files": [

packages/b2c-tooling-sdk/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@salesforce/b2c-tooling-sdk",
3-
"version": "0.0.1-preview",
3+
"version": "0.0.2",
44
"description": "Core tooling library for Salesforce Commerce Cloud B2C CLI",
55
"author": "Charles Lavery",
66
"license": "Apache-2.0",
@@ -12,6 +12,10 @@
1212
"tooling"
1313
],
1414
"type": "module",
15+
"publishConfig": {
16+
"access": "public",
17+
"registry": "https://registry.npmjs.org/"
18+
},
1519
"exports": {
1620
"./package.json": "./package.json",
1721
".": {

0 commit comments

Comments
 (0)