@@ -35,16 +35,52 @@ jobs:
35
35
fail-fast : false
36
36
matrix :
37
37
config :
38
- - {name: "ubuntu-22.04", os: "ubuntu-22.04", cmake_extra: "-DLSL_BUNDLED_PUGIXML=OFF" }
39
- - {name: "ubuntu-24.04", os: "ubuntu-24.04", cmake_extra: "-DLSL_BUNDLED_PUGIXML=OFF" }
40
- - {name: "windows-x64", os: "windows-latest", cmake_extra: "-T v142,host=x86"}
41
- - {name: "windows-32", os: "windows-latest", cmake_extra: "-T v142,host=x86 -A Win32"}
38
+ # - {name: "ubuntu-22.04", os: "ubuntu-22.04", cmake_extra: "-DLSL_BUNDLED_PUGIXML=OFF" }
39
+ # - {name: "ubuntu-24.04", os: "ubuntu-24.04", cmake_extra: "-DLSL_BUNDLED_PUGIXML=OFF" }
40
+ # - {name: "windows-x64", os: "windows-latest", cmake_extra: "-T v142,host=x86"}
41
+ # - {name: "windows-32", os: "windows-latest", cmake_extra: "-T v142,host=x86 -A Win32"}
42
42
- {name: "macOS-latest", os: "macOS-latest", cmake_extra: "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_OSX_ARCHITECTURES=x86_64;arm64 -DLSL_FRAMEWORK=ON" }
43
43
44
44
steps :
45
45
- uses : actions/checkout@v4
46
46
47
+ - name : Install certificates and provisioning profiles
48
+ if : matrix.config.os == 'macOS-latest'
49
+ env :
50
+ MACOS_CERTIFICATE_APP : ${{ secrets.PROD_MACOS_CERTIFICATE }}
51
+ MACOS_CERTIFICATE_INST : ${{ secrets.PROD_MACOS_CERTIFICATE_INST }}
52
+ MACOS_CERTIFICATE_PWD : ${{ secrets.PROD_MACOS_CERTIFICATE_PWD }}
53
+ MACOS_CI_KEYCHAIN_PWD : ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}
54
+ run : |
55
+ # Create temporary keychain
56
+ KEYCHAIN_PATH=$RUNNER_TEMP/build.keychain
57
+ security create-keychain -p "$MACOS_CI_KEYCHAIN_PWD" $KEYCHAIN_PATH
58
+ security default-keychain -s $KEYCHAIN_PATH
59
+ security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
60
+ security unlock-keychain -p "$MACOS_CI_KEYCHAIN_PWD" $KEYCHAIN_PATH
61
+
62
+ # Import certificates from secrets ...
63
+ CERTIFICATE_PATH_APP=$RUNNER_TEMP/build_certificate_app.p12
64
+ CERTIFICATE_PATH_INST=$RUNNER_TEMP/build_certificate_inst.p12
65
+ echo -n "$MACOS_CERTIFICATE_APP" | base64 --decode -o $CERTIFICATE_PATH_APP
66
+ echo -n "$MACOS_CERTIFICATE_INST" | base64 --decode -o $CERTIFICATE_PATH_INST
67
+ # ... to keychain
68
+ security import $CERTIFICATE_PATH_APP -P "$MACOS_CERTIFICATE_PWD" -k $KEYCHAIN_PATH -A -t cert -f pkcs12
69
+ security import $CERTIFICATE_PATH_INST -P "$MACOS_CERTIFICATE_PWD" -k $KEYCHAIN_PATH -A -t cert -f pkcs12
70
+
71
+ # Set trusted partitions (groups of applications) that can access the keychain items
72
+ security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_CI_KEYCHAIN_PWD" $KEYCHAIN_PATH
73
+ security list-keychain -d user -s $KEYCHAIN_PATH
74
+
75
+ # Get certificate identities into environment variables
76
+ CERT_IDENTITY_APP=$(security find-identity -v -p codesigning $KEYCHAIN_PATH | grep "Developer ID Application" | head -1 | awk -F'"' '{print $2}')
77
+ echo "APPLE_CODE_SIGN_IDENTITY_APP=$CERT_IDENTITY_APP" >> $GITHUB_ENV
78
+ CERT_IDENTITY_INST=$(security find-identity -v -p basic $KEYCHAIN_PATH | grep "Developer ID Installer" | head -1 | awk -F'"' '{print $2}')
79
+ echo "APPLE_CODE_SIGN_IDENTITY_INST=$CERT_IDENTITY_INST" >> $GITHUB_ENV
80
+
47
81
- name : Configure CMake
82
+ env :
83
+ APPLE_DEVELOPMENT_TEAM : ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}
48
84
run : |
49
85
if [[ "${{ matrix.config.name }}" = ubuntu-2* ]]; then
50
86
sudo apt-get install -y --no-install-recommends libpugixml-dev
60
96
-Dlslgitbranch=${{ github.ref }} \
61
97
${{ matrix.config.cmake_extra }} \
62
98
${{ github.event.inputs.cmakeextra }}
63
- echo ${PWD}
99
+ echo ${PWD}
64
100
65
101
- name : make
66
102
run : cmake --build build --config Release -j
@@ -80,7 +116,24 @@ jobs:
80
116
cmake --build examples/build --target install --config Release -j
81
117
./examples/build/install/bin/HandleMetaData
82
118
83
- - name : package
119
+ - name : code signing (macOS)
120
+ if : matrix.config.os == 'macOS-latest'
121
+ run : |
122
+ # Sign the binary
123
+ codesign -vvv --force --sign "$APPLE_CODE_SIGN_IDENTITY_APP" \
124
+ --entitlements lsl.entitlements \
125
+ --timestamp --options runtime \
126
+ install/Frameworks/lsl.framework/Versions/A/lsl
127
+ codesign -vvv --verify --deep --strict install/Frameworks/lsl.framework/Versions/A/lsl
128
+ # Sign the framework itself
129
+ codesign -vvv --force --deep --sign "$APPLE_CODE_SIGN_IDENTITY_APP" \
130
+ --entitlements lsl.entitlements \
131
+ --timestamp --options runtime \
132
+ install/Frameworks/lsl.framework
133
+ codesign -vvv --verify --deep --strict install/Frameworks/lsl.framework
134
+
135
+ - name : package (ubuntu, windows)
136
+ if : matrix.config.os != 'macOS-latest'
84
137
run : |
85
138
echo $GITHUB_REF
86
139
cmake --build build --target package --config Release -j
@@ -99,6 +152,31 @@ jobs:
99
152
cmake -E remove_directory package/_CPack_Packages
100
153
cp testing/lslcfgs/default.cfg .
101
154
155
+ - name : package and notarize (macOS)
156
+ if : matrix.config.os == 'macOS-latest'
157
+ env :
158
+ APPLE_DEVELOPMENT_TEAM : ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}
159
+ APPLE_NOTARIZE_USERNAME : ${{ secrets.PROD_MACOS_NOTARIZATION_APPLE_ID }}
160
+ APPLE_NOTARIZE_PASSWORD : ${{ secrets.PROD_MACOS_NOTARIZATION_PWD }}
161
+ run : |
162
+ # CMake does a lousy job of creating .pkg files for macOS, so we do it manually
163
+ # TODO: However, we need to get the version number from the CMake package!
164
+ productbuild --sign "$APPLE_CODE_SIGN_IDENTITY_INST" \
165
+ --component install/Frameworks/lsl.framework \
166
+ /Library/Frameworks liblsl-1.16.2-Darwin-universal.pkg
167
+ # Notarize the package
168
+ xcrun notarytool submit liblsl-1.16.2-Darwin-universal.pkg \
169
+ --apple-id "$APPLE_NOTARIZE_USERNAME" \
170
+ --password "$APPLE_NOTARIZE_PASSWORD" \
171
+ --team-id "$APPLE_DEVELOPMENT_TEAM" \
172
+ --wait
173
+ # Staple the notarization ticket to the package
174
+ xcrun stapler staple liblsl-1.16.2-Darwin-universal.pkg
175
+ # If notarization fails, you can get the history of notarization requests:
176
+ # xcrun notarytool history --apple-id "$APPLE_NOTARIZE_USERNAME" --password "$APPLE_NOTARIZE_PASSWORD" --team-id "$APPLE_DEVELOPMENT_TEAM"
177
+ # Then you can check the status of a specific request:
178
+ # xcrun notarytool log <request-id> --apple-id "$APPLE_NOTARIZE_USERNAME" --password "$APPLE_NOTARIZE_PASSWORD" --team-id "$APPLE_DEVELOPMENT_TEAM"
179
+
102
180
- name : upload install dir
103
181
uses : actions/upload-artifact@master
104
182
with :
@@ -120,7 +198,7 @@ jobs:
120
198
ip route
121
199
ip -6 route
122
200
fi
123
-
201
+
124
202
# run internal tests
125
203
- name : unit tests
126
204
run : |
@@ -159,3 +237,8 @@ jobs:
159
237
MIME=$(file --mime-type $pkg|cut -d ' ' -f2)
160
238
curl -X POST -H "Accept: application/vnd.github.v3+json" -H "Authorization: $TOKEN" -H "Content-Type: $MIME" --data-binary @$pkg $UPLOAD_URL?name=$NAME
161
239
done
240
+
241
+ - name : Clean up keychain
242
+ if : matrix.config.os == 'macOS-latest'
243
+ run : |
244
+ security delete-keychain $RUNNER_TEMP/app-signing.keychain-db || true
0 commit comments