1- name : Split & Release
1+ name : Split & Release (DEBUG MODE)
22
33on :
44 workflow_dispatch :
@@ -28,13 +28,17 @@ jobs:
2828 - name : Parse packages
2929 id : parse
3030 run : |
31+ echo "🔍 DEBUG MODE: This workflow will show what would happen without making actual releases"
32+ echo "=========================================="
33+
3134 # Create a temp file to avoid shell injection
3235 cat > packages.json << 'EOF'
3336 ${{ github.event.inputs.packages }}
3437 EOF
3538
36- echo "Raw packages file:"
39+ echo "📄 Raw packages file:"
3740 cat packages.json
41+ echo ""
3842
3943 # Validate JSON
4044 if ! jq empty packages.json 2>/dev/null; then
@@ -51,16 +55,17 @@ jobs:
5155 IS_PRERELEASE=false
5256 fi
5357
54- echo "Parsed packages:"
58+ echo "📦 Parsed packages:"
5559 jq -r 'to_entries[] | "\(.key): Messages=[\(.value["release-message"] | join(", "))] Stability=\(.value["minimum-stability"] // "unknown")"' packages.json
5660
5761 package_list=$(jq -r 'keys | @json' packages.json)
5862 echo "package-list=$package_list" >> $GITHUB_OUTPUT
5963 echo "core-version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
6064 echo "is-prerelease=$IS_PRERELEASE" >> $GITHUB_OUTPUT
6165
62- echo "Package list for matrix: $package_list"
63- echo "Is prerelease: $IS_PRERELEASE"
66+ echo "📋 Package list for matrix: $package_list"
67+ echo "🔍 Is prerelease: $IS_PRERELEASE"
68+ echo "=========================================="
6469
6570 split :
6671 needs : prepare
@@ -75,62 +80,162 @@ jobs:
7580 steps :
7681 - uses : actions/checkout@v4
7782
78- - name : Replace core version in composer.json
83+ - name : DEBUG - Show package info
84+ run : |
85+ echo "🔍 DEBUG: Processing package: ${{ matrix.package }}"
86+ echo "🔍 DEBUG: Version: ${{ needs.prepare.outputs.core-version }}"
87+ echo "🔍 DEBUG: Is prerelease: ${{ needs.prepare.outputs.is-prerelease }}"
88+ echo "🔍 DEBUG: Working directory: packages/${{ matrix.package }}"
89+
90+ if [ -d "packages/${{ matrix.package }}" ]; then
91+ echo "✅ Package directory exists"
92+ ls -la packages/${{ matrix.package }}/
93+ else
94+ echo "❌ Package directory does not exist"
95+ fi
96+
97+ - name : DEBUG - Show composer.json changes that would be made
7998 working-directory : packages/${{ matrix.package }}
8099 run : |
81100 if [ -f composer.json ]; then
82- echo "Updating moox/core version in ${{ matrix.package }} to ${{ needs.prepare.outputs.core-version }}"
83- sed -i 's/"moox\/core": "[^"]*"/"moox\/core": "${{ needs.prepare.outputs.core-version }}"/g' composer.json
84- echo "Updated composer.json:"
101+ echo "📄 Current composer.json:"
102+ cat composer.json
103+
104+ echo ""
105+ echo "🔍 DEBUG: Would update moox/core version to: ${{ needs.prepare.outputs.core-version }}"
106+
107+ # Show what the sed command would do
108+ echo "🔍 DEBUG: sed command would be:"
109+ echo "sed -i 's/\"moox\/core\": \"[^\"]*\"/\"moox\/core\": \"${{ needs.prepare.outputs.core-version }}\"/g' composer.json"
110+
111+ # Show current moox/core dependency
112+ echo "🔍 DEBUG: Current moox/core dependency:"
85113 grep "moox/core" composer.json || echo "No moox/core dependency found"
86114 else
87- echo "No composer.json found in ${{ matrix.package }}"
115+ echo "❌ No composer.json found in ${{ matrix.package }}"
88116 fi
89117
90- - name : Commit changes
118+ - name : DEBUG - Show what would be committed
91119 working-directory : packages/${{ matrix.package }}
92120 run : |
93121 if [ -f composer.json ]; then
94- git config user.name "github-actions"
95- git config user.email "[email protected] " 96- git add composer.json
97- git commit -m "Update moox/core dependency to ${{ needs.prepare.outputs.core-version }}" || echo "No changes to commit"
122+ echo "🔍 DEBUG: Would commit with message:"
123+ echo "Update moox/core dependency to ${{ needs.prepare.outputs.core-version }}"
124+
125+ echo ""
126+ echo "🔍 DEBUG: Git config would be:"
127+ echo "user.name: github-actions"
128+ echo "user.email: [email protected] " 129+ else
130+ echo "❌ No composer.json to commit"
98131 fi
99132
100- - name : Split package to separate repository
101- 102- env :
103- GITHUB_TOKEN : ${{ github.event.inputs.user_token != '' && github.event.inputs.user_token || secrets.BOT }}
104- with :
105- tag : " ${{ github.event.inputs.version }}"
106- package_directory : " packages/${{ matrix.package }}"
107- repository_organization : " mooxphp"
108- repository_name : " ${{ matrix.package }}"
109-
110- - name : Create GitHub Release for split package
133+ - name : DEBUG - Show split action parameters
134+ run : |
135+ echo "🔍 DEBUG: Split action parameters:"
136+ echo " - tag: ${{ github.event.inputs.version }}"
137+ echo " - package_directory: packages/${{ matrix.package }}"
138+ echo " - repository_organization: mooxphp"
139+ echo " - repository_name: ${{ matrix.package }}"
140+ echo " - GITHUB_TOKEN: [would use user_token if provided, otherwise secrets.BOT]"
141+
142+ - name : DEBUG - Show release creation parameters
111143 run : |
112144 PACKAGE="${{ matrix.package }}"
113145 VERSION="${{ github.event.inputs.version }}"
114146 RELEASE_BODY=$(echo '${{ github.event.inputs.packages }}' | jq -r ".\"$PACKAGE\".\"release-message\" // [] | .[:10] | join(\"\\n\")")
147+ STABILITY=$(echo '${{ github.event.inputs.packages }}' | jq -r ".\"$PACKAGE\".\"moox-stability\" // \"dev\"")
115148
116- echo "Creating release for $PACKAGE $VERSION"
117- echo "Release notes:"
118- echo "$RELEASE_BODY"
119-
120- # Wait for tag propagation
121- sleep 10
149+ echo "🔍 DEBUG: Release creation parameters for $PACKAGE:"
150+ echo " - Package: $PACKAGE"
151+ echo " - Version: $VERSION"
152+ echo " - Stability: $STABILITY"
153+ echo " - Is prerelease: ${{ needs.prepare.outputs.is-prerelease }}"
154+ echo " - Release notes: $RELEASE_BODY"
155+ echo " - Repository: mooxphp/$PACKAGE"
122156
123- if [ "${{ needs.prepare.outputs.is-prerelease }}" = "true" ]; then
124- gh release create "$VERSION" \
125- --repo "mooxphp/$PACKAGE" \
126- --title "Release $VERSION" \
127- --notes "$RELEASE_BODY" \
128- --prerelease
157+ # Show what would happen
158+ if [ "$STABILITY" != "dev" ]; then
159+ echo "✅ Would create release for $PACKAGE (stability: $STABILITY)"
160+ if [ "${{ needs.prepare.outputs.is-prerelease }}" = "true" ]; then
161+ echo "🔍 DEBUG: Would run: gh release create \"$VERSION\" --repo \"mooxphp/$PACKAGE\" --title \"Release $VERSION\" --notes \"$RELEASE_BODY\" --prerelease"
162+ else
163+ echo "🔍 DEBUG: Would run: gh release create \"$VERSION\" --repo \"mooxphp/$PACKAGE\" --title \"Release $VERSION\" --notes \"$RELEASE_BODY\""
164+ fi
129165 else
130- gh release create "$VERSION" \
131- --repo "mooxphp/$PACKAGE" \
132- --title "Release $VERSION" \
133- --notes "$RELEASE_BODY"
166+ echo "⏭️ Would skip release for $PACKAGE (stability: dev)"
167+ echo " Package would be split to repository but no release would be created"
134168 fi
135- env :
136- GH_TOKEN : ${{ github.event.inputs.user_token != '' && github.event.inputs.user_token || secrets.TOKEN }}
169+
170+ # Commented out actual actions for debug mode
171+ # - name: Replace core version in composer.json
172+ # working-directory: packages/${{ matrix.package }}
173+ # run: |
174+ # if [ -f composer.json ]; then
175+ # echo "Updating moox/core version in ${{ matrix.package }} to ${{ needs.prepare.outputs.core-version }}"
176+ # sed -i 's/"moox\/core": "[^"]*"/"moox\/core": "${{ needs.prepare.outputs.core-version }}"/g' composer.json
177+ # echo "Updated composer.json:"
178+ # grep "moox/core" composer.json || echo "No moox/core dependency found"
179+ # else
180+ # echo "No composer.json found in ${{ matrix.package }}"
181+ # fi
182+
183+ # - name: Commit changes
184+ # working-directory: packages/${{ matrix.package }}
185+ # run: |
186+ # if [ -f composer.json ]; then
187+ # git config user.name "github-actions"
188+ # git config user.email "[email protected] " 189+ # git add composer.json
190+ # git commit -m "Update moox/core dependency to ${{ needs.prepare.outputs.core-version }}" || echo "No changes to commit"
191+ # fi
192+
193+ # - name: Split package to separate repository
194+ # uses: symplify/[email protected] 195+ # env:
196+ # GITHUB_TOKEN: ${{ github.event.inputs.user_token != '' && github.event.inputs.user_token || secrets.BOT }}
197+ # with:
198+ # tag: "${{ github.event.inputs.version }}"
199+ # package_directory: "packages/${{ matrix.package }}"
200+ # repository_organization: "mooxphp"
201+ # repository_name: "${{ matrix.package }}"
202+
203+ # - name: Create GitHub Release for split package
204+ # run: |
205+ # PACKAGE="${{ matrix.package }}"
206+ # VERSION="${{ github.event.inputs.version }}"
207+ # RELEASE_BODY=$(echo '${{ github.event.inputs.packages }}' | jq -r ".\"$PACKAGE\".\"release-message\" // [] | .[:10] | join(\"\\n\")")
208+ # STABILITY=$(echo '${{ github.event.inputs.packages }}' | jq -r ".\"$PACKAGE\".\"moox-stability\" // \"dev\"")
209+
210+ # echo "Package: $PACKAGE"
211+ # echo "Version: $VERSION"
212+ # echo "Stability: $STABILITY"
213+ # echo "Release notes: $RELEASE_BODY"
214+
215+ # # Only create release if stability is not 'dev'
216+ # if [ "$STABILITY" != "dev" ]; then
217+ # echo "✅ Creating release for $PACKAGE (stability: $STABILITY)"
218+
219+ # # Wait for tag propagation
220+ # sleep 10
221+
222+ # if [ "${{ needs.prepare.outputs.is-prerelease }}" = "true" ]; then
223+ # gh release create "$VERSION" \
224+ # --repo "mooxphp/$PACKAGE" \
225+ # --title "Release $VERSION" \
226+ # --notes "$RELEASE_BODY" \
227+ # --prerelease
228+ # else
229+ # gh release create "$VERSION" \
230+ # --repo "mooxphp/$PACKAGE" \
231+ # --title "Release $VERSION" \
232+ # --notes "$RELEASE_BODY"
233+ # fi
234+
235+ # echo "✅ Release created successfully"
236+ # else
237+ # echo "⏭️ Skipping release for $PACKAGE (stability: dev)"
238+ # echo " Package was split to repository but no release was created"
239+ # fi
240+ # env:
241+ # GH_TOKEN: ${{ github.event.inputs.user_token != '' && github.event.inputs.user_token || secrets.TOKEN }}
0 commit comments