2020 typescript-published : ${{ steps.publish-typescript.outputs.published }}
2121 react-published : ${{ steps.publish-react.outputs.published }}
2222 next-published : ${{ steps.publish-next.outputs.published }}
23+ echo-start-published : ${{ steps.publish-echo-start.outputs.published }}
2324 version : ${{ steps.get-version.outputs.version }}
2425
2526 steps :
@@ -43,22 +44,22 @@ jobs:
4344
4445 - name : Get version from TypeScript SDK
4546 id : get-version
46- working-directory : ./echo-typescript- sdk
47+ working-directory : ./packages/ sdk/ts
4748 run : |
4849 PACKAGE_VERSION=$(node -p "require('./package.json').version")
4950 echo "version=$PACKAGE_VERSION" >> $GITHUB_OUTPUT
5051 echo "📦 Release version: $PACKAGE_VERSION"
5152
5253 # TypeScript SDK
5354 - name : Build TypeScript SDK
54- working-directory : ./echo-typescript- sdk
55+ working-directory : ./packages/ sdk/ts
5556 run : |
5657 echo "🔨 Building TypeScript SDK..."
5758 pnpm run build
5859 echo "✅ TypeScript SDK built"
5960
6061 - name : Test TypeScript SDK
61- working-directory : ./echo-typescript- sdk
62+ working-directory : ./packages/ sdk/ts
6263 run : |
6364 echo "🧪 Testing TypeScript SDK..."
6465 pnpm run test
6768
6869 - name : Check and publish TypeScript SDK
6970 id : publish-typescript
70- working-directory : ./echo-typescript- sdk
71+ working-directory : ./packages/ sdk/ts
7172 env :
7273 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
7374 run : |
@@ -95,14 +96,14 @@ jobs:
9596
9697 # React SDK
9798 - name : Build React SDK
98- working-directory : ./echo-react- sdk
99+ working-directory : ./packages/ sdk/react
99100 run : |
100101 echo "🔨 Building React SDK..."
101102 pnpm run build
102103 echo "✅ React SDK built"
103104
104105 - name : Test React SDK
105- working-directory : ./echo-react- sdk
106+ working-directory : ./packages/ sdk/react
106107 run : |
107108 echo "🧪 Testing React SDK..."
108109 # Note: Some authentication-related tests are currently failing due to SSR removal
@@ -113,7 +114,7 @@ jobs:
113114
114115 - name : Check and publish React SDK
115116 id : publish-react
116- working-directory : ./echo-react- sdk
117+ working-directory : ./packages/ sdk/react
117118 env :
118119 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
119120 run : |
@@ -141,14 +142,14 @@ jobs:
141142
142143 # Next.js SDK
143144 - name : Build Next.js SDK
144- working-directory : ./echo-next- sdk
145+ working-directory : ./packages/ sdk/next
145146 run : |
146147 echo "🔨 Building Next.js SDK..."
147148 pnpm run build
148149 echo "✅ Next.js SDK built"
149150
150151 - name : Test Next.js SDK
151- working-directory : ./echo-next- sdk
152+ working-directory : ./packages/ sdk/next
152153 run : |
153154 echo "🧪 Testing Next.js SDK..."
154155 pnpm run test
@@ -157,7 +158,51 @@ jobs:
157158
158159 - name : Check and publish Next.js SDK
159160 id : publish-next
160- working-directory : ./echo-next-sdk
161+ working-directory : ./packages/sdk/next
162+ env :
163+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
164+ run : |
165+ PACKAGE_NAME=$(node -p "require('./package.json').name")
166+ PACKAGE_VERSION=$(node -p "require('./package.json').version")
167+ FORCE_PUBLISH="${{ github.event.inputs.force_publish }}"
168+
169+ if npm view "$PACKAGE_NAME@$PACKAGE_VERSION" version 2>/dev/null; then
170+ if [ "$FORCE_PUBLISH" = "true" ]; then
171+ echo "⚠️ Version $PACKAGE_VERSION of $PACKAGE_NAME already exists on npm, but force_publish is enabled"
172+ echo "🚀 Publishing $PACKAGE_NAME to npm..."
173+ npm publish --access public
174+ echo "published=true" >> $GITHUB_OUTPUT
175+ echo "✅ Successfully published $PACKAGE_NAME"
176+ else
177+ echo "❌ Version $PACKAGE_VERSION of $PACKAGE_NAME already exists on npm - skipping"
178+ echo "published=false" >> $GITHUB_OUTPUT
179+ fi
180+ else
181+ echo "🚀 Publishing $PACKAGE_NAME to npm..."
182+ npm publish --access public
183+ echo "published=true" >> $GITHUB_OUTPUT
184+ echo "✅ Successfully published $PACKAGE_NAME"
185+ fi
186+
187+ # Echo Start CLI
188+ - name : Build Echo Start CLI
189+ working-directory : ./packages/sdk/echo-start
190+ run : |
191+ echo "🔨 Building Echo Start CLI..."
192+ pnpm run build
193+ echo "✅ Echo Start CLI built"
194+
195+ - name : Test Echo Start CLI
196+ working-directory : ./packages/sdk/echo-start
197+ run : |
198+ echo "🧪 Testing Echo Start CLI..."
199+ pnpm run type-check
200+ pnpm run lint
201+ echo "✅ Echo Start CLI tests passed"
202+
203+ - name : Check and publish Echo Start CLI
204+ id : publish-echo-start
205+ working-directory : ./packages/sdk/echo-start
161206 env :
162207 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
163208 run : |
@@ -187,7 +232,7 @@ jobs:
187232 name : Create version tag
188233 runs-on : ubuntu-latest
189234 needs : publish
190- if : (needs.publish.outputs.typescript-published == 'true' || needs.publish.outputs.react-published == 'true' || needs.publish.outputs.next-published == 'true') && github.ref == 'refs/heads/production' && !startsWith(github.ref, 'refs/tags/')
235+ if : (needs.publish.outputs.typescript-published == 'true' || needs.publish.outputs.react-published == 'true' || needs.publish.outputs.next-published == 'true' || needs.publish.outputs.echo-start-published == 'true' ) && github.ref == 'refs/heads/production' && !startsWith(github.ref, 'refs/tags/')
191236
192237 steps :
193238 - name : Checkout code
@@ -248,12 +293,14 @@ jobs:
248293 - \`@merit-systems/echo-typescript-sdk\`
249294 - \`@merit-systems/echo-react-sdk\`
250295 - \`@merit-systems/echo-next-sdk\`
296+ - \`echo-start\` (CLI tool)
251297
252298 ### Installation
253299 \`\`\`bash
254300 npm install @merit-systems/echo-typescript-sdk
255301 npm install @merit-systems/echo-react-sdk
256302 npm install @merit-systems/echo-next-sdk
303+ npm install -g echo-start
257304 \`\`\`
258305
259306 This tag was automatically created after successful npm publishing from the production branch.
0 commit comments