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
+
1
4
name : Notarize the app (macOS)
2
5
3
6
inputs :
4
7
APPLE_ID :
5
8
required : true
6
9
APPLE_PW :
7
10
required : true
11
+ DAILY :
12
+ type : boolean
13
+ required : false
8
14
DEV_ID :
9
15
required : true
10
16
KEYCHAIN_PATH :
@@ -89,12 +95,19 @@ runs:
89
95
done
90
96
91
97
- name : Copy the icon file to the app bundle
98
+ env :
99
+ DAILY : ${{ inputs.DAILY }}
92
100
shell : bash
93
101
run : |
94
102
for TARGET in $(find build -name "DB Browser for SQL*.app" | sed -e 's/ /_/g'); do
95
103
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
98
111
done
99
112
100
113
- name : Sign the manually added extensions.
@@ -114,23 +127,47 @@ runs:
114
127
shell : bash
115
128
run : mv build/*.app installer/macos
116
129
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
117
133
- name : Create the DMG
118
134
env :
135
+ DAILY : ${{ inputs.DAILY }}
119
136
DEV_ID : ${{ inputs.DEV_ID }}
120
137
shell : bash
121
138
run : |
139
+ export DATE=$(date +%Y%m%d)
140
+
122
141
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
128
156
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
134
171
fi
135
172
136
173
- name : Notarize the dmg
@@ -139,16 +176,8 @@ runs:
139
176
APPLE_PW : ${{ inputs.APPLE_PW }}
140
177
TEAM_ID : ${{ inputs.TEAM_ID }}
141
178
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
147
180
148
181
- name : Staple the notarization ticket
149
182
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