5252 # All validation checks passed
5353 echo "should-publish=true" >> $GITHUB_OUTPUT
5454
55- # Job 1: Determine which packages need to be published
55+ # Job 1: Detect which release channels (stable/beta) were affected
56+ # Looks for changelog edits in the merge commit
57+ detect-release :
58+ needs : validate-release
59+ if : needs.validate-release.outputs.should-publish == 'true'
60+ runs-on : ubuntu-latest
61+ outputs :
62+ has-stable-release : ${{ steps.detect.outputs.has-stable-release }}
63+ has-beta-release : ${{ steps.detect.outputs.has-beta-release }}
64+ steps :
65+ - name : Checkout
66+ uses : actions/checkout@v4
67+ with :
68+ fetch-depth : 2
69+
70+ - name : Detect release type
71+ id : detect
72+ run : |
73+ CHANGED_FILES=$(git diff HEAD^ HEAD --name-only)
74+
75+ echo "Changed files:" >> $GITHUB_STEP_SUMMARY
76+ echo '```' >> $GITHUB_STEP_SUMMARY
77+ echo "$CHANGED_FILES" >> $GITHUB_STEP_SUMMARY
78+ echo '```' >> $GITHUB_STEP_SUMMARY
79+
80+ if echo "$CHANGED_FILES" | grep -q '^packages/eds-core-react/CHANGELOG\.md$'; then
81+ echo "has-stable-release=true" >> $GITHUB_OUTPUT
82+ echo "- ✅ Stable changelog updated" >> $GITHUB_STEP_SUMMARY
83+ else
84+ echo "has-stable-release=false" >> $GITHUB_OUTPUT
85+ echo "- ⏭️ Stable changelog unchanged" >> $GITHUB_STEP_SUMMARY
86+ fi
87+
88+ if echo "$CHANGED_FILES" | grep -q '^packages/eds-core-react/src/components/next/CHANGELOG\.md$'; then
89+ echo "has-beta-release=true" >> $GITHUB_OUTPUT
90+ echo "- ✅ Beta changelog updated" >> $GITHUB_STEP_SUMMARY
91+ else
92+ echo "has-beta-release=false" >> $GITHUB_OUTPUT
93+ echo "- ⏭️ Beta changelog unchanged" >> $GITHUB_STEP_SUMMARY
94+ fi
95+
96+ # Job 2: Determine which packages need publishing
5697 # Checks the release-please-manifest.json to see which packages had version changes
5798 check-releases :
5899 needs : validate-release
@@ -152,35 +193,56 @@ jobs:
152193 echo "" >> $GITHUB_STEP_SUMMARY
153194 echo "📝 **Note:** eds-utils is published as part of eds-core-react" >> $GITHUB_STEP_SUMMARY
154195
155- # Job 2: Trigger core-react publish workflow
156- # Only runs if core-react package.json was changed
157- trigger-core-react :
158- needs : check-releases
159- if : needs.check-releases.outputs.core-react == 'true'
196+ # Job 3: Trigger core-react stable publish workflow
197+ trigger-core-react-stable :
198+ needs : [validate-release, detect-release, check-releases]
199+ if : needs.validate-release.outputs.should-publish == 'true' && needs.detect-release.outputs.has-stable-release == 'true' && needs.check-releases.outputs.core-react == 'true'
160200 runs-on : ubuntu-latest
161201 steps :
162- - name : Trigger core-react publish
202+ - name : Trigger core-react stable publish
163203 id : trigger
164204 env :
165- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }} # GitHub token for gh CLI authentication
205+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
166206 run : |
167- # Use GitHub CLI to trigger the publish workflow
168207 gh workflow run publish_core_react.yaml \
169208 --repo ${{ github.repository }} \
170209 --ref main \
171210 -f npm-tag=latest \
172211 -f environment=production
173- # Allow other packages to continue even if this one fails
174212 continue-on-error : true
175213
176214 - name : Report failure
177215 if : steps.trigger.outcome == 'failure'
178216 run : |
179- echo "::error title=Core React Publish Failed::Failed to trigger publish workflow for @equinor/eds-core-react"
180- echo "❌ Failed to trigger core-react publish workflow" >> $GITHUB_STEP_SUMMARY
217+ echo "::error title=Core React Stable Publish Failed::Failed to trigger stable publish workflow for @equinor/eds-core-react"
218+ echo "❌ Failed to trigger stable publish workflow" >> $GITHUB_STEP_SUMMARY
181219
182- # Job 3: Trigger lab-react publish workflow
183- # Only runs if lab-react package.json was changed
220+ # Job 4: Trigger core-react beta publish workflow
221+ trigger-core-react-beta :
222+ needs : [validate-release, detect-release, check-releases]
223+ if : needs.validate-release.outputs.should-publish == 'true' && needs.detect-release.outputs.has-beta-release == 'true' && needs.check-releases.outputs.core-react == 'true'
224+ runs-on : ubuntu-latest
225+ steps :
226+ - name : Trigger core-react beta publish
227+ id : trigger
228+ env :
229+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
230+ run : |
231+ gh workflow run publish_core_react.yaml \
232+ --repo ${{ github.repository }} \
233+ --ref main \
234+ -f npm-tag=beta \
235+ -f environment=production
236+ continue-on-error : true
237+
238+ - name : Report failure
239+ if : steps.trigger.outcome == 'failure'
240+ run : |
241+ echo "::error title=Core React Beta Publish Failed::Failed to trigger beta publish workflow for @equinor/eds-core-react"
242+ echo "❌ Failed to trigger beta publish workflow" >> $GITHUB_STEP_SUMMARY
243+
244+ # Job 5: Trigger lab-react publish workflow
245+ # Only runs if the Release Please manifest bumped lab-react
184246 trigger-lab-react :
185247 needs : check-releases
186248 if : needs.check-releases.outputs.lab-react == 'true'
@@ -204,8 +266,8 @@ jobs:
204266 echo "::error title=Lab React Publish Failed::Failed to trigger publish workflow for @equinor/eds-lab-react"
205267 echo "❌ Failed to trigger lab-react publish workflow" >> $GITHUB_STEP_SUMMARY
206268
207- # Job 4 : Trigger data-grid-react publish workflow
208- # Only runs if data-grid-react package.json was changed
269+ # Job 6 : Trigger data-grid-react publish workflow
270+ # Only runs if the Release Please manifest bumped data-grid-react
209271 trigger-data-grid-react :
210272 needs : check-releases
211273 if : needs.check-releases.outputs.data-grid-react == 'true'
@@ -229,8 +291,8 @@ jobs:
229291 echo "::error title=Data Grid React Publish Failed::Failed to trigger publish workflow for @equinor/eds-data-grid-react"
230292 echo "❌ Failed to trigger data-grid-react publish workflow" >> $GITHUB_STEP_SUMMARY
231293
232- # Job 5 : Trigger icons publish workflow
233- # Only runs if icons package.json was changed
294+ # Job 7 : Trigger icons publish workflow
295+ # Only runs if the Release Please manifest bumped icons
234296 trigger-icons :
235297 needs : check-releases
236298 if : needs.check-releases.outputs.icons == 'true'
@@ -253,8 +315,8 @@ jobs:
253315 echo "::error title=Icons Publish Failed::Failed to trigger publish workflow for @equinor/eds-icons"
254316 echo "❌ Failed to trigger icons publish workflow" >> $GITHUB_STEP_SUMMARY
255317
256- # Job 6 : Trigger tokens publish workflow
257- # Only runs if tokens package.json was changed
318+ # Job 8 : Trigger tokens publish workflow
319+ # Only runs if the Release Please manifest bumped tokens
258320 trigger-tokens :
259321 needs : check-releases
260322 if : needs.check-releases.outputs.tokens == 'true'
@@ -277,12 +339,13 @@ jobs:
277339 echo "::error title=Tokens Publish Failed::Failed to trigger publish workflow for @equinor/eds-tokens"
278340 echo "❌ Failed to trigger tokens publish workflow" >> $GITHUB_STEP_SUMMARY
279341
280- # Job 7 : Summary report of all publish triggers
342+ # Job 9 : Summary report of all publish triggers
281343 # Runs independently after check-releases completes
282344 # Provides a clear overview of which packages were triggered for publishing
283345 publish-summary :
284346 needs :
285347 - validate-release
348+ - detect-release
286349 - check-releases
287350 # Always run this job, even if some trigger jobs failed or were skipped
288351 if : always()
@@ -312,6 +375,22 @@ jobs:
312375 echo "## 📦 Package Publish Trigger Summary" >> $GITHUB_STEP_SUMMARY
313376 echo "" >> $GITHUB_STEP_SUMMARY
314377 echo "This workflow triggered publish workflows for packages that had version changes." >> $GITHUB_STEP_SUMMARY
378+ echo "" >> $GITHUB_STEP_SUMMARY
379+ echo "### Release types detected" >> $GITHUB_STEP_SUMMARY
380+ echo "" >> $GITHUB_STEP_SUMMARY
381+
382+ if [ "${{ needs.detect-release.outputs.has-stable-release }}" == "true" ]; then
383+ echo "- ✅ Stable changelog updated" >> $GITHUB_STEP_SUMMARY
384+ else
385+ echo "- ⏭️ Stable changelog unchanged" >> $GITHUB_STEP_SUMMARY
386+ fi
387+
388+ if [ "${{ needs.detect-release.outputs.has-beta-release }}" == "true" ]; then
389+ echo "- ✅ Beta changelog updated" >> $GITHUB_STEP_SUMMARY
390+ else
391+ echo "- ⏭️ Beta changelog unchanged" >> $GITHUB_STEP_SUMMARY
392+ fi
393+
315394 echo "" >> $GITHUB_STEP_SUMMARY
316395 echo "### Results:" >> $GITHUB_STEP_SUMMARY
317396 echo "" >> $GITHUB_STEP_SUMMARY
0 commit comments