1+ # if [ "${{ inputs.DAILY }}" = "false" ]; then
2+ # FIXME: When triggered by a push event, the DAILY value was not set, so I temporarily set the condition like in the code above.
3+
14name : Notarize the app (macOS)
25
36inputs :
47 APPLE_ID :
58 required : true
69 APPLE_PW :
710 required : true
11+ DAILY :
12+ type : boolean
13+ required : false
814 DEV_ID :
915 required : true
1016 KEYCHAIN_PATH :
@@ -89,12 +95,19 @@ runs:
8995 done
9096
9197 - name : Copy the icon file to the app bundle
98+ env :
99+ DAILY : ${{ inputs.DAILY }}
92100 shell : bash
93101 run : |
94102 for TARGET in $(find build -name "DB Browser for SQL*.app" | sed -e 's/ /_/g'); do
95103 TARGET=$(echo $TARGET | sed -e 's/_/ /g')
96- cp installer/macos/macapp.icns "$TARGET/Contents/Resources/"
97- /usr/libexec/PlistBuddy -c "Set :CFBundleIconFile macapp.icns" "$TARGET/Contents/Info.plist"
104+ if [ "${{ inputs.DAILY }}" = "" ] || [ "${{ inputs.DAILY }}" = "false" ]; then
105+ cp installer/macos/macapp.icns "$TARGET/Contents/Resources/"
106+ /usr/libexec/PlistBuddy -c "Set :CFBundleIconFile macapp.icns" "$TARGET/Contents/Info.plist"
107+ else
108+ cp installer/macos/macapp-nightly.icns "$TARGET/Contents/Resources/"
109+ /usr/libexec/PlistBuddy -c "Set :CFBundleIconFile macapp-nightly.icns" "$TARGET/Contents/Info.plist"
110+ fi
98111 done
99112
100113 - name : Sign the manually added extensions.
@@ -114,23 +127,47 @@ runs:
114127 shell : bash
115128 run : mv build/*.app installer/macos
116129
130+ # TODO: I originally tried to break it into two steps to make it more readable,
131+ # but Composite Actions do not support if statements for steps.
132+ # For more information, see https://github.com/actions/runner/blob/main/docs/adrs/0549-composite-run-steps.md
117133 - name : Create the DMG
118134 env :
135+ DAILY : ${{ inputs.DAILY }}
119136 DEV_ID : ${{ inputs.DEV_ID }}
120137 shell : bash
121138 run : |
139+ export DATE=$(date +%Y%m%d)
140+
122141 if [ "${{ inputs.SQLCIPHER }}" = "1" ]; then
123- sed -i "" 's/"DB Browser for SQLCipher Nightly.app"/"DB Browser for SQLCipher-dev-'$(git rev-parse --short --verify HEAD)'.app"/' installer/macos/sqlcipher-nightly.json
124- TARGET="DB Browser for SQLCipher-dev-$(git rev-parse --short --verify HEAD).dmg"
125- appdmg --quiet installer/macos/sqlcipher-nightly.json "$TARGET"
126- codesign --sign "$DEV_ID" --verbose --options=runtime --timestamp "$TARGET"
127- codesign -vvv --deep --strict --verbose=4 "$TARGET"
142+ if [ "${{ inputs.DAILY }}" = "" ] || [ "${{ inputs.DAILY }}" = "false" ]; then
143+ # Continuous with SQLCipher
144+ sed -i "" 's/"DB Browser for SQLCipher Nightly.app"/"DB Browser for SQLCipher-dev-'$(git rev-parse --short --verify HEAD)'.app"/' installer/macos/sqlcipher-nightly.json
145+ TARGET="DB.Browser.for.SQLCipher-dev-$(git rev-parse --short --verify HEAD).dmg"
146+ appdmg --quiet installer/macos/sqlcipher-nightly.json "$TARGET"
147+ codesign --sign "$DEV_ID" --verbose --options=runtime --timestamp "$TARGET"
148+ codesign -vvv --deep --strict --verbose=4 "$TARGET"
149+ else
150+ # Daily with SQLCipher
151+ TARGET="DB.Browser.for.SQLCipher-universal_$DATE.dmg"
152+ appdmg --quiet installer/macos/sqlcipher-nightly.json "$TARGET"
153+ codesign --sign "$DEV_ID" --verbose --options=runtime --timestamp "$TARGET"
154+ codesign -vvv --deep --strict --verbose=4 "$TARGET"
155+ fi
128156 else
129- sed -i "" 's/"DB Browser for SQLite Nightly.app"/"DB Browser for SQLite-dev-'$(git rev-parse --short --verify HEAD)'.app"/' installer/macos/nightly.json
130- TARGET="DB Browser for SQLite-dev-$(git rev-parse --short --verify HEAD).dmg"
131- appdmg --quiet installer/macos/nightly.json "$TARGET"
132- codesign --sign "$DEV_ID" --verbose --options=runtime --timestamp "$TARGET"
133- codesign -vvv --deep --strict --verbose=4 "$TARGET"
157+ if [ "${{ inputs.DAILY }}" = "" ] || [ "${{ inputs.DAILY }}" = "false" ]; then
158+ # Continuous without SQLCipher
159+ sed -i "" 's/"DB Browser for SQLite Nightly.app"/"DB Browser for SQLite-dev-'$(git rev-parse --short --verify HEAD)'.app"/' installer/macos/nightly.json
160+ TARGET="DB.Browser.for.SQLite-dev-$(git rev-parse --short --verify HEAD).dmg"
161+ appdmg --quiet installer/macos/nightly.json "$TARGET"
162+ codesign --sign "$DEV_ID" --verbose --options=runtime --timestamp "$TARGET"
163+ codesign -vvv --deep --strict --verbose=4 "$TARGET"
164+ else
165+ # Daily without SQLCipher
166+ TARGET="DB.Browser.for.SQLite-universal_$DATE.dmg"
167+ appdmg --quiet installer/macos/nightly.json "$TARGET"
168+ codesign --sign "$DEV_ID" --verbose --options=runtime --timestamp "$TARGET"
169+ codesign -vvv --deep --strict --verbose=4 "$TARGET"
170+ fi
134171 fi
135172
136173 - name : Notarize the dmg
@@ -139,16 +176,8 @@ runs:
139176 APPLE_PW : ${{ inputs.APPLE_PW }}
140177 TEAM_ID : ${{ inputs.TEAM_ID }}
141178 shell : bash
142- run : |
143- for TARGET in $(find . -name "DB Browser for SQL*.dmg" | sed -e 's/ /_/g'); do
144- TARGET=$(echo $TARGET | sed -e 's/_/ /g')
145- xcrun notarytool submit "$TARGET" --apple-id "$APPLE_ID" --password "$APPLE_PW" --team-id "$TEAM_ID" --wait
146- done
179+ run : xcrun notarytool submit *.dmg --apple-id "$APPLE_ID" --password "$APPLE_PW" --team-id "$TEAM_ID" --wait
147180
148181 - name : Staple the notarization ticket
149182 shell : bash
150- run : |
151- for TARGET in $(find . -name "DB Browser for SQL*.dmg" | sed -e 's/ /_/g'); do
152- TARGET=$(echo $TARGET | sed -e 's/_/ /g')
153- xcrun stapler staple "$TARGET"
154- done
183+ run : xcrun stapler staple *.dmg
0 commit comments