@@ -13,15 +13,25 @@ jobs:
13
13
os : [macos-latest]
14
14
15
15
steps :
16
- - uses : actions/checkout@v1
16
+ - uses : actions/checkout@v4
17
+ - name : set env vars
18
+ run : |
19
+ if [ ${{github.ref_name}} == 'juce8' ]; then
20
+ echo "GUI_BRANCH=development-juce8" >> "$GITHUB_ENV"
21
+ elif [ ${{github.ref_name}} == 'testing-juce8' ]; then
22
+ echo "GUI_BRANCH=testing-juce8" >> "$GITHUB_ENV"
23
+ else
24
+ echo "Invalid branch : ${{github.ref_name}}"
25
+ exit 1
26
+ fi
17
27
- name : setup
18
28
run : |
19
29
cd ../..
20
- git clone https://github.com/open-ephys/plugin-GUI.git --branch main
30
+ git clone https://github.com/open-ephys/plugin-GUI.git --branch $GUI_BRANCH
21
31
cd plugin-GUI/Build && cmake -G "Xcode" ..
22
32
cd ../..
23
33
mkdir OEPlugins && cd OEPlugins
24
- git clone https://github.com/open-ephys-plugins/OpenEphysFFTW.git
34
+ git clone https://github.com/open-ephys-plugins/OpenEphysFFTW.git --branch ${{github.ref_name}}
25
35
cd OpenEphysFFTW/Build
26
36
cmake -G "Xcode" ..
27
37
xcodebuild -target install -configuration Release
@@ -32,18 +42,71 @@ jobs:
32
42
xcodebuild -configuration Release
33
43
# - name: test
34
44
# run: cd build && ctest
35
- - name : deploy
36
- if : github.ref == 'refs/heads/main '
45
+ - name : codesign_deploy
46
+ if : github.ref == 'refs/heads/testing-juce8 '
37
47
env :
38
- artifactoryApiKey : ${{ secrets.artifactoryApiKey }}
48
+ ARTIFACTORY_ACCESS_TOKEN : ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
49
+ MACOS_CERTIFICATE : ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
50
+ MACOS_CERTIFICATE_PWD : ${{ secrets.BUILD_CERTIFICATE_PWD }}
51
+ MACOS_CERTIFICATE_NAME : ${{ secrets.BUILD_CERTIFICATE_NAME }}
52
+ MACOS_CI_KEYCHAIN_PWD : ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}
53
+ PROD_MACOS_NOTARIZATION_APPLE_ID : ${{ secrets.PROD_MACOS_NOTARIZATION_APPLE_ID }}
54
+ PROD_MACOS_NOTARIZATION_TEAM_ID : ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}
55
+ PROD_MACOS_NOTARIZATION_PWD : ${{ secrets.PROD_MACOS_NOTARIZATION_PWD }}
39
56
build_dir : " Build/Release"
40
57
package : SpectrumViewer-mac
41
58
run : |
42
59
plugin_api=$(grep -rnw ../../plugin-GUI/Source -e '#define PLUGIN_API_VER' | grep -Eo "[0-9]" | tail -1)
43
- tag=$(git describe --tags $(git rev-list --tags --max-count=1) )
60
+ tag=$(grep -w Source/OpenEphysLib.cpp -e 'info->libVersion' | grep -Eo "[0-9]+.[0-9]+.[0-9]+" )
44
61
new_plugin_ver=$tag-API$plugin_api
62
+
45
63
mkdir plugins
46
64
cp -r $build_dir/*.bundle plugins
65
+
66
+ # Turn our base64-encoded certificate back to a regular .p12 file
67
+ echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
68
+
69
+ # We need to create a new keychain, otherwise using the certificate will prompt
70
+ # with a UI dialog asking for the certificate password, which we can't
71
+ # use in a headless CI environment
72
+ security create-keychain -p $MACOS_CI_KEYCHAIN_PWD build.keychain
73
+ security default-keychain -s build.keychain
74
+ security unlock-keychain -p $MACOS_CI_KEYCHAIN_PWD build.keychain
75
+ security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
76
+ security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $MACOS_CI_KEYCHAIN_PWD build.keychain
77
+ /usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" -v plugins/spectrum-viewer.bundle --deep --strict --timestamp --options=runtime
78
+
79
+ /usr/bin/codesign -dv --verbose=4 plugins/spectrum-viewer.bundle
80
+
81
+ # Store the notarization credentials so that we can prevent a UI password dialog from blocking the CI
82
+
83
+ echo "Create keychain profile"
84
+ xcrun notarytool store-credentials "notarytool-profile" --apple-id "$PROD_MACOS_NOTARIZATION_APPLE_ID" --team-id "$PROD_MACOS_NOTARIZATION_TEAM_ID" --password "$PROD_MACOS_NOTARIZATION_PWD"
85
+
86
+ # We can't notarize an app bundle directly, but we need to compress it as an archive.
87
+ # Therefore, we create a zip file containing our app bundle, so that we can send it to the
88
+ # notarization service
89
+
90
+ echo "Creating temp notarization archive"
91
+ /usr/bin/ditto -c -k --sequesterRsrc --keepParent plugins/spectrum-viewer.bundle spectrum-viewer.zip
92
+
93
+ # Here we send the notarization request to the Apple's Notarization service, waiting for the result.
94
+ # This typically takes a few seconds inside a CI environment, but it might take more depending on the App
95
+ # characteristics. Visit the Notarization docs for more information and strategies on how to optimize it if
96
+ # you're curious
97
+
98
+ echo "Notarize app"
99
+ xcrun notarytool submit "spectrum-viewer.zip" --keychain-profile "notarytool-profile" --wait
100
+
101
+ # Finally, we need to "attach the staple" to our executable, which will allow our app to be
102
+ # validated by macOS even when an internet connection is not available.
103
+ echo "Attach staple"
104
+ rm -r plugins/*
105
+ /usr/bin/ditto -x -k spectrum-viewer.zip plugins
106
+ xcrun stapler staple plugins/spectrum-viewer.bundle
107
+
108
+ spctl -vvv --assess --type exec plugins/spectrum-viewer.bundle
109
+
47
110
zipfile=${package}_${new_plugin_ver}.zip
48
- zip -r -X $zipfile plugins
49
- curl -H "X-JFrog-Art-Api:$artifactoryApiKey " -T $zipfile "https://openephys.jfrog.io/artifactory/SpectrumViewer-plugin/mac/$zipfile"
111
+ /usr/bin/ditto -c -k --sequesterRsrc --keepParent plugins $zipfile
112
+ curl -H "X-JFrog-Art-Api:$ARTIFACTORY_ACCESS_TOKEN " -T $zipfile "https://openephys.jfrog.io/artifactory/SpectrumViewer-plugin/mac/$zipfile"
0 commit comments