2727 fetch-depth : 0
2828
2929 - name : Install pnpm
30- run : npm install -g pnpm
30+ run : npm install -g pnpm@10.11.0
3131
3232 - name : Setup Node.js
3333 uses : actions/setup-node@v4
@@ -84,10 +84,17 @@ jobs:
8484 PACKAGE_NAME=$(node -p "require('./package.json').name")
8585 PACKAGE_VERSION=$(node -p "require('./package.json').version")
8686
87- echo "🚀 Publishing $PACKAGE_NAME@$PACKAGE_VERSION to test tag..."
88- pnpm publish --access public --tag test --no-git-checks
89- echo "published=true" >> $GITHUB_OUTPUT
90- echo "✅ Successfully published $PACKAGE_NAME to test tag"
87+ if [ "${{ github.event_name }}" = "pull_request" ]; then
88+ echo "🔍 Validating $PACKAGE_NAME@$PACKAGE_VERSION with publish dry-run..."
89+ pnpm publish --dry-run --access public --tag test --no-git-checks
90+ echo "published=false" >> $GITHUB_OUTPUT
91+ echo "✅ Successfully validated $PACKAGE_NAME publish"
92+ else
93+ echo "🚀 Publishing $PACKAGE_NAME@$PACKAGE_VERSION to test tag..."
94+ pnpm publish --access public --tag test --no-git-checks
95+ echo "published=true" >> $GITHUB_OUTPUT
96+ echo "✅ Successfully published $PACKAGE_NAME to test tag"
97+ fi
9198
9299 # React SDK
93100 - name : Version and build React SDK
@@ -126,10 +133,17 @@ jobs:
126133 PACKAGE_NAME=$(node -p "require('./package.json').name")
127134 PACKAGE_VERSION=$(node -p "require('./package.json').version")
128135
129- echo "🚀 Publishing $PACKAGE_NAME@$PACKAGE_VERSION to test tag..."
130- pnpm publish --access public --tag test --no-git-checks
131- echo "published=true" >> $GITHUB_OUTPUT
132- echo "✅ Successfully published $PACKAGE_NAME to test tag"
136+ if [ "${{ github.event_name }}" = "pull_request" ]; then
137+ echo "🔍 Validating $PACKAGE_NAME@$PACKAGE_VERSION with publish dry-run..."
138+ pnpm publish --dry-run --access public --tag test --no-git-checks
139+ echo "published=false" >> $GITHUB_OUTPUT
140+ echo "✅ Successfully validated $PACKAGE_NAME publish"
141+ else
142+ echo "🚀 Publishing $PACKAGE_NAME@$PACKAGE_VERSION to test tag..."
143+ pnpm publish --access public --tag test --no-git-checks
144+ echo "published=true" >> $GITHUB_OUTPUT
145+ echo "✅ Successfully published $PACKAGE_NAME to test tag"
146+ fi
133147
134148 # Next.js SDK
135149 - name : Version and build Next.js SDK
@@ -168,10 +182,17 @@ jobs:
168182 PACKAGE_NAME=$(node -p "require('./package.json').name")
169183 PACKAGE_VERSION=$(node -p "require('./package.json').version")
170184
171- echo "🚀 Publishing $PACKAGE_NAME@$PACKAGE_VERSION to test tag..."
172- pnpm publish --access public --tag test --no-git-checks
173- echo "published=true" >> $GITHUB_OUTPUT
174- echo "✅ Successfully published $PACKAGE_NAME to test tag"
185+ if [ "${{ github.event_name }}" = "pull_request" ]; then
186+ echo "🔍 Validating $PACKAGE_NAME@$PACKAGE_VERSION with publish dry-run..."
187+ pnpm publish --dry-run --access public --tag test --no-git-checks
188+ echo "published=false" >> $GITHUB_OUTPUT
189+ echo "✅ Successfully validated $PACKAGE_NAME publish"
190+ else
191+ echo "🚀 Publishing $PACKAGE_NAME@$PACKAGE_VERSION to test tag..."
192+ pnpm publish --access public --tag test --no-git-checks
193+ echo "published=true" >> $GITHUB_OUTPUT
194+ echo "✅ Successfully published $PACKAGE_NAME to test tag"
195+ fi
175196
176197 # AIx402 SDK
177198 - name : Version and build AIx402 SDK
@@ -210,10 +231,17 @@ jobs:
210231 PACKAGE_NAME=$(node -p "require('./package.json').name")
211232 PACKAGE_VERSION=$(node -p "require('./package.json').version")
212233
213- echo "🚀 Publishing $PACKAGE_NAME@$PACKAGE_VERSION to test tag..."
214- pnpm publish --access public --tag test --no-git-checks
215- echo "published=true" >> $GITHUB_OUTPUT
216- echo "✅ Successfully published $PACKAGE_NAME to test tag"
234+ if [ "${{ github.event_name }}" = "pull_request" ]; then
235+ echo "🔍 Validating $PACKAGE_NAME@$PACKAGE_VERSION with publish dry-run..."
236+ pnpm publish --dry-run --access public --tag test --no-git-checks
237+ echo "published=false" >> $GITHUB_OUTPUT
238+ echo "✅ Successfully validated $PACKAGE_NAME publish"
239+ else
240+ echo "🚀 Publishing $PACKAGE_NAME@$PACKAGE_VERSION to test tag..."
241+ pnpm publish --access public --tag test --no-git-checks
242+ echo "published=true" >> $GITHUB_OUTPUT
243+ echo "✅ Successfully published $PACKAGE_NAME to test tag"
244+ fi
217245
218246 # Echo Start CLI
219247 - name : Version and build Echo Start CLI
@@ -252,15 +280,26 @@ jobs:
252280 PACKAGE_NAME=$(node -p "require('./package.json').name")
253281 PACKAGE_VERSION=$(node -p "require('./package.json').version")
254282
255- echo "🚀 Publishing $PACKAGE_NAME@$PACKAGE_VERSION to test tag..."
256- pnpm publish --access public --tag test --no-git-checks
257- echo "published=true" >> $GITHUB_OUTPUT
258- echo "✅ Successfully published $PACKAGE_NAME to test tag"
283+ if [ "${{ github.event_name }}" = "pull_request" ]; then
284+ echo "🔍 Validating $PACKAGE_NAME@$PACKAGE_VERSION with publish dry-run..."
285+ pnpm publish --dry-run --access public --tag test --no-git-checks
286+ echo "published=false" >> $GITHUB_OUTPUT
287+ echo "✅ Successfully validated $PACKAGE_NAME publish"
288+ else
289+ echo "🚀 Publishing $PACKAGE_NAME@$PACKAGE_VERSION to test tag..."
290+ pnpm publish --access public --tag test --no-git-checks
291+ echo "published=true" >> $GITHUB_OUTPUT
292+ echo "✅ Successfully published $PACKAGE_NAME to test tag"
293+ fi
259294
260295 - name : Summary
261296 run : |
262- echo "✅ Test version published successfully!"
297+ if [ "${{ github.event_name }}" = "pull_request" ]; then
298+ echo "✅ Test version validated successfully!"
299+ else
300+ echo "✅ Test version published successfully!"
301+ fi
263302 echo "📦 Version: ${{ steps.get-version.outputs.version }}"
264303 echo "🏷️ Tag: test"
265304 echo ""
266- echo "Install with: npm install @merit-systems/echo-typescript-sdk@test"
305+ echo "Install with: npm install @merit-systems/echo-typescript-sdk@test"
0 commit comments