@@ -144,9 +144,7 @@ jobs:
144144 uses : actions/upload-artifact@v4
145145 with :
146146 name : " ${{ env.APP_NAME }}-artifacts-linux${{ matrix.demo && '-demo' || '' }}"
147- path : |
148- *.AppImage
149- *.zip
147+ path : ${{ matrix.demo && '*.AppImage' || '*.zip' }}
150148 if-no-files-found : error
151149
152150 build-mac :
@@ -185,7 +183,38 @@ jobs:
185183 - name : Deploy
186184 run : |
187185 macdeployqt "build/${{ env.APP_NAME }}.app" -dmg -verbose=2
188- mv "build/${{ env.APP_NAME }}.dmg" "${{ env.APP_NAME }}-${{ env.PACKAGE_VERSION }}${{ matrix.demo && '-demo' || '' }}.dmg"
186+
187+ - name : Remove xattr attributes from dmg
188+ run : |
189+ set -e
190+ dmgfile="build/${{ env.APP_NAME }}.dmg"
191+ # 1. Mount the .dmg if it exists
192+ if [ -f "$dmgfile" ]; then
193+ echo "Mounting '${dmgfile}'..."
194+ hdiutil attach "${dmgfile}"
195+ else
196+ echo "'${dmgfile}' file does not exist."
197+ exit 1
198+ fi
199+
200+ # 2. Copy the app to /tmp
201+ echo "Copying the application from the mounted volume..."
202+ cp -R "/Volumes/${{ env.APP_NAME }}/${{ env.APP_NAME }}.app" "/tmp/${{ env.APP_NAME }}.app"
203+
204+ # 3. Remove extended attributes (quarantine, etc.)
205+ echo "Removing extended attributes..."
206+ xattr -rc "/tmp/${{ env.APP_NAME }}.app"
207+
208+ # 4. Create a new clean
209+ echo "Creating the clean .dmg..."
210+ hdiutil create -volname "Subtivals" \
211+ -srcfolder"/tmp/${{ env.APP_NAME }}.app" \
212+ -format UDZO \
213+ -ov "${{ env.APP_NAME }}-${{ env.PACKAGE_VERSION }}${{ matrix.demo && '-demo' || '' }}.dmg"
214+
215+ # 5. Detach the mounted volume
216+ echo "Detaching the volume..."
217+ hdiutil detach "/Volumes/${{ env.APP_NAME }}"
189218
190219 - name : Zip builds
191220 if : matrix.demo == false
@@ -196,9 +225,7 @@ jobs:
196225 uses : actions/upload-artifact@v4
197226 with :
198227 name : " ${{ env.APP_NAME }}-artifacts-mac${{ matrix.demo && '-demo' || '' }}"
199- path : |
200- *.dmg
201- *.zip
228+ path : ${{ matrix.demo && '*.dmg' || '*.zip' }}
202229 if-no-files-found : error
203230
204231 build-windows :
@@ -272,7 +299,9 @@ jobs:
272299 - name : Create NSIS installer
273300 run : |
274301 makensis /DAPP_NAME="${{ env.APP_NAME }}" /DPACKAGE_VERSION="${{ env.PACKAGE_VERSION }}" win-installer\installer.nsi
275- REN "win-installer\${{ env.APP_NAME }}-${{ env.PACKAGE_VERSION }}.exe" "${{ env.APP_NAME }}-${{ env.PACKAGE_VERSION }}${{ matrix.demo && '-demo' || '' }}.exe"
302+
303+ - run : |
304+ MOVE "win-installer\${{ env.APP_NAME }}-${{ env.PACKAGE_VERSION }}.exe" "${{ env.APP_NAME }}-${{ env.PACKAGE_VERSION }}${{ matrix.demo == 'true' && '-demo' || '' }}.exe"
276305
277306 - name : Zip builds
278307 if : matrix.demo == false
@@ -283,9 +312,7 @@ jobs:
283312 uses : actions/upload-artifact@v4
284313 with :
285314 name : " ${{ env.APP_NAME }}-artifacts-win${{ matrix.demo && '-demo' || '' }}"
286- path : |
287- *.exe
288- *.zip
315+ path : ${{ matrix.demo && '*.exe' || '*.zip' }}
289316 if-no-files-found : error
290317
291318 release :
0 commit comments