1818 build-server :
1919 name : Build Server JAR
2020 runs-on : ubuntu-latest
21+ # Only run for compose-* releases or manual dispatch
22+ if : startsWith(github.ref, 'refs/tags/compose-') || github.event_name == 'workflow_dispatch'
2123 permissions :
2224 contents : write
2325 pull-requests : write
@@ -55,22 +57,24 @@ jobs:
5557 - name : Build mpp-server fat JAR
5658 run : ./gradlew :mpp-server:fatJar --no-daemon
5759
58- - name : Clean build cache to save space (Linux only)
59- run : |
60- ./gradlew :mpp-server:clean
61- rm -rf ~/.gradle/caches/modules-2/files-2.1
62- df -h
63-
6460 - name : Upload Server JAR
6561 uses : actions/upload-artifact@v4
6662 with :
6763 name : server-jar
6864 path : mpp-server/build/libs/*-all.jar
6965
66+ - name : Clean build cache to save space (Linux only)
67+ run : |
68+ ./gradlew :mpp-server:clean
69+ rm -rf ~/.gradle/caches/modules-2/files-2.1
70+ df -h
71+
7072 # Build Android APK
7173 build-android :
7274 name : Build Android APK
7375 runs-on : ubuntu-latest
76+ # Only run for compose-* releases or manual dispatch
77+ if : startsWith(github.ref, 'refs/tags/compose-') || github.event_name == 'workflow_dispatch'
7478 permissions :
7579 contents : write
7680 pull-requests : write
@@ -110,13 +114,6 @@ jobs:
110114 - name : Build Android Release APK
111115 run : ./gradlew :mpp-ui:assembleRelease --no-daemon
112116
113- - name : Clean build cache to save space (Linux only)
114- run : |
115- ./gradlew :mpp-ui:clean
116- rm -rf ~/.gradle/caches/modules-2/files-2.1
117- rm -rf ~/.gradle/caches/transforms-*
118- df -h
119-
120117 - name : Upload Android APKs
121118 uses : actions/upload-artifact@v4
122119 with :
@@ -125,10 +122,19 @@ jobs:
125122 mpp-ui/build/outputs/apk/debug/*.apk
126123 mpp-ui/build/outputs/apk/release/*.apk
127124
125+ - name : Clean build cache to save space (Linux only)
126+ run : |
127+ ./gradlew :mpp-ui:clean
128+ rm -rf ~/.gradle/caches/modules-2/files-2.1
129+ rm -rf ~/.gradle/caches/transforms-*
130+ df -h
131+
128132 # Build Desktop packages for multiple platforms
129133 build-desktop :
130134 name : Build Desktop (${{ matrix.os }})
131135 runs-on : ${{ matrix.os }}
136+ # Only run for compose-* releases or manual dispatch
137+ if : startsWith(github.ref, 'refs/tags/compose-') || github.event_name == 'workflow_dispatch'
132138 permissions :
133139 contents : write
134140 pull-requests : write
@@ -186,6 +192,12 @@ jobs:
186192 - name : Build Desktop package
187193 run : ./gradlew :mpp-ui:${{ matrix.task }} --no-daemon
188194
195+ - name : Upload Desktop package
196+ uses : actions/upload-artifact@v4
197+ with :
198+ name : ${{ matrix.artifact }}
199+ path : ${{ matrix.path }}
200+
189201 - name : Clean build cache to save space (Unix)
190202 if : runner.os != 'Windows'
191203 run : |
@@ -201,12 +213,6 @@ jobs:
201213 if (Test-Path "$env:USERPROFILE\.gradle\caches\modules-2\files-2.1") {
202214 Remove-Item -Recurse -Force "$env:USERPROFILE\.gradle\caches\modules-2\files-2.1"
203215 }
204-
205- - name : Upload Desktop package
206- uses : actions/upload-artifact@v4
207- with :
208- name : ${{ matrix.artifact }}
209- path : ${{ matrix.path }}
210216 # Create release with all artifacts
211217 create-release :
212218 name : Create Release
@@ -216,8 +222,8 @@ jobs:
216222 contents : write
217223 pull-requests : write
218224
219- # Only run for compose-* tags to avoid conflicts with main release workflow
220- if : startsWith(github.ref, 'refs/tags/compose-')
225+ # Only run for compose-* tags or manual dispatch
226+ if : startsWith(github.ref, 'refs/tags/compose-') || github.event_name == 'workflow_dispatch'
221227 steps :
222228 - name : Checkout code
223229 uses : actions/checkout@v4
@@ -226,9 +232,16 @@ jobs:
226232 uses : actions/download-artifact@v4
227233 with :
228234 path : artifacts
235+ continue-on-error : true
229236
230237 - name : Display structure of downloaded files
231- run : ls -la artifacts/
238+ run : |
239+ if [ -d "artifacts" ]; then
240+ ls -la artifacts/
241+ else
242+ echo "No artifacts directory found"
243+ mkdir -p artifacts
244+ fi
232245
233246 - name : Create Release
234247 uses : softprops/action-gh-release@v2
@@ -256,5 +269,6 @@ jobs:
256269 artifacts/**/*
257270 draft : false
258271 prerelease : true
272+ fail_on_unmatched_files : false
259273 env :
260274 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments