@@ -92,37 +92,69 @@ jobs:
9292 with :
9393 name : Specify_macos
9494
95+ - name : Inspect directory structure
96+ run : |
97+ echo "Current directory:"
98+ pwd
99+ echo "Contents of current directory:"
100+ ls -R
101+
95102 - name : Sign binaries in JAR files
96103 run : |
97104 # For libgluegen-rt.jnilib
98- mkdir -p temp_gluegen
99- cd temp_gluegen
100- unzip ../Specify_macos/Specify\ Installer.app/Contents/Resources/app/0.dat/wwlibs/gluegen-rt-natives-macosx-universal.jar
101- codesign --force --options runtime --sign "Developer ID Application: $APPLE_TEAM_ID" --timestamp libgluegen-rt.jnilib
102- zip -u ../Specify_macos/Specify\ Installer.app/Contents/Resources/app/0.dat/wwlibs/gluegen-rt-natives-macosx-universal.jar libgluegen-rt.jnilib
103- cd ..
104- rm -rf temp_gluegen
105+ GLUEGEN_JAR=$(find . -name "gluegen-rt-natives-macosx-universal.jar")
106+ if [ -n "$GLUEGEN_JAR" ]; then
107+ mkdir -p temp_gluegen
108+ cd temp_gluegen
109+ unzip "../$GLUEGEN_JAR"
110+ if [ -f "libgluegen-rt.jnilib" ]; then
111+ codesign --force --options runtime --sign "Developer ID Application: $APPLE_TEAM_ID" --timestamp libgluegen-rt.jnilib
112+ zip -u "../$GLUEGEN_JAR" libgluegen-rt.jnilib
113+ else
114+ echo "libgluegen-rt.jnilib not found in the JAR"
115+ fi
116+ cd ..
117+ rm -rf temp_gluegen
118+ else
119+ echo "gluegen-rt-natives-macosx-universal.jar not found"
120+ fi
105121
106122 # For mac-universal.lib
107- mkdir -p temp_sqlitejdbc
108- cd temp_sqlitejdbc
109- unzip ../Specify_macos/Specify\ Installer.app/Contents/Resources/app/0.dat/libs/sqlitejdbc.jar
110- codesign --force --options runtime --sign "Developer ID Application: $APPLE_TEAM_ID" --timestamp mac-universal.lib
111- zip -u ../Specify_macos/Specify\ Installer.app/Contents/Resources/app/0.dat/libs/sqlitejdbc.jar mac-universal.lib
112- cd ..
113- rm -rf temp_sqlitejdbc
123+ SQLITE_JAR=$(find . -name "sqlitejdbc.jar")
124+ if [ -n "$SQLITE_JAR" ]; then
125+ mkdir -p temp_sqlitejdbc
126+ cd temp_sqlitejdbc
127+ unzip "../$SQLITE_JAR"
128+ if [ -f "mac-universal.lib" ]; then
129+ codesign --force --options runtime --sign "Developer ID Application: $APPLE_TEAM_ID" --timestamp mac-universal.lib
130+ zip -u "../$SQLITE_JAR" mac-universal.lib
131+ else
132+ echo "mac-universal.lib not found in the JAR"
133+ fi
134+ cd ..
135+ rm -rf temp_sqlitejdbc
136+ else
137+ echo "sqlitejdbc.jar not found"
138+ fi
114139 env :
115140 APPLE_TEAM_ID : ${{ secrets.APPLE_TEAM_ID }}
116141
117142 - name : Re-sign the application
118143 run : |
119- codesign --force --options runtime --sign "Developer ID Application: $APPLE_TEAM_ID" --timestamp Specify_macos/Specify\ Installer.app
144+ APP_PATH=$(find . -name "*.app" -type d)
145+ if [ -n "$APP_PATH" ]; then
146+ codesign --force --options runtime --sign "Developer ID Application: $APPLE_TEAM_ID" --timestamp "$APP_PATH"
147+ else
148+ echo "No .app directory found"
149+ exit 1
150+ fi
120151 env :
121152 APPLE_TEAM_ID : ${{ secrets.APPLE_TEAM_ID }}
122153
123154 - name : Create new DMG
124155 run : |
125- hdiutil create -volname "Specify Installer" -srcfolder Specify_macos/Specify\ Installer.app -ov -format UDZO Specify_macos_signed.dmg
156+ APP_PATH=$(find . -name "*.app" -type d)
157+ hdiutil create -volname "Specify Installer" -srcfolder "$APP_PATH" -ov -format UDZO Specify_macos_signed.dmg
126158
127159 - name : Notarize the Mac package
128160 run : |
0 commit comments