Skip to content

Commit 8d372bf

Browse files
committed
Update GHA workflows for JUCE8
1 parent 9d31493 commit 8d372bf

File tree

3 files changed

+115
-32
lines changed

3 files changed

+115
-32
lines changed

.github/workflows/linux.yml

+17-7
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,27 @@ jobs:
1313
os: [ubuntu-20.04]
1414

1515
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
1727
- name: setup
1828
run: |
1929
sudo apt update
2030
cd ../..
21-
git clone https://github.com/open-ephys/plugin-GUI.git --branch main
31+
git clone https://github.com/open-ephys/plugin-GUI.git --branch $GUI_BRANCH
2232
sudo ./plugin-GUI/Resources/Scripts/install_linux_dependencies.sh
2333
cd plugin-GUI/Build && cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
2434
cd ../..
2535
mkdir OEPlugins && cd OEPlugins
26-
git clone https://github.com/open-ephys-plugins/OpenEphysFFTW.git
36+
git clone https://github.com/open-ephys-plugins/OpenEphysFFTW.git --branch ${{github.ref_name}}
2737
cd OpenEphysFFTW/Build
2838
cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Release ..
2939
make install
@@ -35,17 +45,17 @@ jobs:
3545
# - name: test
3646
# run: cd build && ctest
3747
- name: deploy
38-
if: github.ref == 'refs/heads/main'
48+
if: github.ref == 'refs/heads/testing-juce8'
3949
env:
40-
artifactoryApiKey: ${{ secrets.artifactoryApiKey }}
50+
ARTIFACTORY_ACCESS_TOKEN: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
4151
build_dir: "Build"
4252
package: SpectrumViewer-linux
4353
run: |
4454
plugin_api=$(grep -rnw ../../plugin-GUI/Source -e '#define PLUGIN_API_VER' | grep -Eo "[0-9]*" | tail -1)
45-
tag=$(git describe --tags $(git rev-list --tags --max-count=1))
55+
tag=$(grep -w Source/OpenEphysLib.cpp -e 'info->libVersion' | grep -Eo "[0-9]+.[0-9]+.[0-9]+")
4656
new_plugin_ver=$tag-API$plugin_api
4757
mkdir plugins
4858
cp -r $build_dir/*.so plugins
4959
zipfile=${package}_${new_plugin_ver}.zip
5060
zip -r -X $zipfile plugins
51-
curl -H "X-JFrog-Art-Api:$artifactoryApiKey" -T $zipfile "https://openephys.jfrog.io/artifactory/SpectrumViewer-plugin/linux/$zipfile"
61+
curl -H "X-JFrog-Art-Api:$ARTIFACTORY_ACCESS_TOKEN" -T $zipfile "https://openephys.jfrog.io/artifactory/SpectrumViewer-plugin/linux/$zipfile"

.github/workflows/mac.yml

+72-9
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,25 @@ jobs:
1313
os: [macos-latest]
1414

1515
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
1727
- name: setup
1828
run: |
1929
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
2131
cd plugin-GUI/Build && cmake -G "Xcode" ..
2232
cd ../..
2333
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}}
2535
cd OpenEphysFFTW/Build
2636
cmake -G "Xcode" ..
2737
xcodebuild -target install -configuration Release
@@ -32,18 +42,71 @@ jobs:
3242
xcodebuild -configuration Release
3343
# - name: test
3444
# 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'
3747
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 }}
3956
build_dir: "Build/Release"
4057
package: SpectrumViewer-mac
4158
run: |
4259
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]+")
4461
new_plugin_ver=$tag-API$plugin_api
62+
4563
mkdir plugins
4664
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+
47110
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"

.github/workflows/windows.yml

+26-16
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,40 @@ jobs:
1010
runs-on: ${{ matrix.os }}
1111
strategy:
1212
matrix:
13-
os: [windows-2019]
13+
os: [windows-latest]
1414

1515
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+
echo "GUI_LIB_VERSION=v1.0.0-dev" >> "$GITHUB_ENV"
22+
elif [ ${{github.ref_name}} == 'testing-juce8' ]; then
23+
echo "GUI_BRANCH=testing-juce8" >> "$GITHUB_ENV"
24+
echo "GUI_LIB_VERSION=v1.0.0-alpha" >> "$GITHUB_ENV"
25+
else
26+
echo "Invalid branch : ${{github.ref_name}}"
27+
exit 1
28+
fi
29+
shell: bash
1730
- name: setup
18-
env:
19-
repo: open-ephys-gui
20-
package: "open-ephys-lib"
2131
run: |
2232
cd ../..
23-
git clone https://github.com/open-ephys/plugin-GUI.git --branch main
33+
git clone https://github.com/open-ephys/plugin-GUI.git --branch $GUI_BRANCH
2434
cd plugin-GUI/Build
25-
cmake -G "Visual Studio 16 2019" -A x64 ..
35+
cmake -G "Visual Studio 17 2022" -A x64 ..
2636
mkdir Release && cd Release
27-
curl -L https://openephysgui.jfrog.io/artifactory/Libraries/open-ephys-lib-v0.6.0.zip --output open-ephys-lib.zip
37+
curl -L https://openephys.jfrog.io/artifactory/GUI-binaries/Libraries/open-ephys-lib-$GUI_LIB_VERSION.zip --output open-ephys-lib.zip
2838
unzip open-ephys-lib.zip
2939
shell: bash
3040
- name: config-fftw
3141
run: |
3242
cd ../..
3343
mkdir OEPlugins && cd OEPlugins
34-
git clone https://github.com/open-ephys-plugins/OpenEphysFFTW.git
44+
git clone https://github.com/open-ephys-plugins/OpenEphysFFTW.git --branch ${{github.ref_name}}
3545
cd OpenEphysFFTW/Build
36-
cmake -G "Visual Studio 16 2019" -A x64 ..
46+
cmake -G "Visual Studio 17 2022" -A x64 ..
3747
shell: bash
3848
- name: Add msbuild to PATH
3949
uses: microsoft/[email protected]
@@ -44,7 +54,7 @@ jobs:
4454
- name: configure
4555
run: |
4656
cd Build
47-
cmake -G "Visual Studio 16 2019" -A x64 ..
57+
cmake -G "Visual Studio 17 2022" -A x64 ..
4858
shell: bash
4959
- name: build
5060
run: |
@@ -54,18 +64,18 @@ jobs:
5464
# - name: test
5565
# run: cd build && ctest
5666
- name: deploy
57-
if: github.ref == 'refs/heads/main'
67+
if: github.ref == 'refs/heads/testing-juce8'
5868
env:
59-
artifactoryApiKey: ${{ secrets.artifactoryApiKey }}
69+
ARTIFACTORY_ACCESS_TOKEN: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
6070
build_dir: "Build/Release"
6171
package: SpectrumViewer-windows
6272
run: |
6373
plugin_api=$(grep -rnw ../../plugin-GUI/Source -e '#define PLUGIN_API_VER' | grep -Eo "[0-9]*" | tail -1)
64-
tag=$(git describe --tags $(git rev-list --tags --max-count=1))
74+
tag=$(grep -w Source/OpenEphysLib.cpp -e 'info->libVersion' | grep -Eo "[0-9]+.[0-9]+.[0-9]+")
6575
new_plugin_ver=$tag-API$plugin_api
6676
mkdir plugins
67-
cp -v $build_dir/*.dll plugins
77+
cp $build_dir/*.dll plugins
6878
zipfile=${package}_${new_plugin_ver}.zip
6979
powershell Compress-Archive -Path "plugins" -DestinationPath ${zipfile}
70-
curl -H "X-JFrog-Art-Api:$artifactoryApiKey" -T $zipfile "https://openephys.jfrog.io/artifactory/SpectrumViewer-plugin/windows/$zipfile"
80+
curl -H "X-JFrog-Art-Api:$ARTIFACTORY_ACCESS_TOKEN" -T $zipfile "https://openephys.jfrog.io/artifactory/SpectrumViewer-plugin/windows/$zipfile"
7181
shell: bash

0 commit comments

Comments
 (0)