Skip to content

Commit 0bf0080

Browse files
committed
Update GHA workflows for juce8
1 parent fbef3a6 commit 0bf0080

File tree

3 files changed

+103
-19
lines changed

3 files changed

+103
-19
lines changed

.github/workflows/linux.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,20 @@ jobs:
1313
os: [ubuntu-20.04]
1414

1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1717
with:
1818
submodules: true
19-
- uses: conda-incubator/setup-miniconda@v2
19+
- name: set env vars
20+
run: |
21+
if [ ${{github.ref_name}} == 'juce8' ]; then
22+
echo "GUI_BRANCH=development-juce8" >> "$GITHUB_ENV"
23+
elif [ ${{github.ref_name}} == 'testing-juce8' ]; then
24+
echo "GUI_BRANCH=testing-juce8" >> "$GITHUB_ENV"
25+
else
26+
echo "Invalid branch : ${{github.ref_name}}"
27+
exit 1
28+
fi
29+
- uses: conda-incubator/setup-miniconda@v3
2030
with:
2131
activate-environment: oe-python-plugin
2232
python-version: "3.10"
@@ -25,7 +35,7 @@ jobs:
2535
run: |
2636
sudo apt update
2737
cd ../..
28-
git clone https://github.com/open-ephys/plugin-GUI.git --branch main
38+
git clone https://github.com/open-ephys/plugin-GUI.git --branch $GUI_BRANCH
2939
sudo ./plugin-GUI/Resources/Scripts/install_linux_dependencies.sh
3040
cd plugin-GUI/Build && cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
3141
- name: build
@@ -55,7 +65,7 @@ jobs:
5565
name: ${{ env.zipfile }}
5666
path: ${{ env.zipfile }}
5767
- name: deploy
58-
if: github.ref == 'refs/heads/main'
68+
if: github.ref == 'refs/heads/testing-juce8'
5969
env:
6070
artifactoryApiKey: ${{ secrets.artifactoryApiKey }}
6171
run: |

.github/workflows/mac.yml

Lines changed: 68 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,31 @@ jobs:
1313
os: [macos-latest]
1414

1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1717
with:
1818
submodules: true
19-
- uses: conda-incubator/setup-miniconda@v2
19+
- name: set env vars
20+
run: |
21+
if [ ${{github.ref_name}} == 'juce8' ]; then
22+
echo "GUI_BRANCH=development-juce8" >> "$GITHUB_ENV"
23+
elif [ ${{github.ref_name}} == 'testing-juce8' ]; then
24+
echo "GUI_BRANCH=testing-juce8" >> "$GITHUB_ENV"
25+
else
26+
echo "Invalid branch : ${{github.ref_name}}"
27+
exit 1
28+
fi
29+
- uses: maxim-lobanov/setup-xcode@v1
30+
with:
31+
xcode-version: latest-stable
32+
- uses: conda-incubator/setup-miniconda@v3
2033
with:
2134
activate-environment: oe-python-plugin
2235
python-version: "3.10"
2336
auto-activate-base: false
2437
- name: setup
2538
run: |
2639
cd ../..
27-
git clone https://github.com/open-ephys/plugin-GUI.git --branch main
40+
git clone https://github.com/open-ephys/plugin-GUI.git --branch $GUI_BRANCH
2841
cd plugin-GUI/Build && cmake -G "Xcode" ..
2942
- name: build
3043
run: |
@@ -35,6 +48,13 @@ jobs:
3548
# run: cd build && ctest
3649
- name: package
3750
env:
51+
MACOS_CERTIFICATE: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
52+
MACOS_CERTIFICATE_PWD: ${{ secrets.BUILD_CERTIFICATE_PWD }}
53+
MACOS_CERTIFICATE_NAME: ${{ secrets.BUILD_CERTIFICATE_NAME }}
54+
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}
55+
PROD_MACOS_NOTARIZATION_APPLE_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_APPLE_ID }}
56+
PROD_MACOS_NOTARIZATION_TEAM_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}
57+
PROD_MACOS_NOTARIZATION_PWD: ${{ secrets.PROD_MACOS_NOTARIZATION_PWD }}
3858
build_dir: "Build/Release"
3959
package: PythonProcessor-mac
4060
run: |
@@ -44,6 +64,50 @@ jobs:
4464
mkdir plugins
4565
cp -r $build_dir/*.bundle plugins
4666
mv $build_dir/shared .
67+
68+
# Turn our base64-encoded certificate back to a regular .p12 file
69+
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
70+
71+
# We need to create a new keychain, otherwise using the certificate will prompt
72+
# with a UI dialog asking for the certificate password, which we can't
73+
# use in a headless CI environment
74+
security create-keychain -p $MACOS_CI_KEYCHAIN_PWD build.keychain
75+
security default-keychain -s build.keychain
76+
security unlock-keychain -p $MACOS_CI_KEYCHAIN_PWD build.keychain
77+
security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
78+
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $MACOS_CI_KEYCHAIN_PWD build.keychain
79+
/usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" -v plugins/python-processor.bundle --deep --strict --timestamp --options=runtime
80+
/usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" -v shared/libpython3.10.dylib --deep --strict --timestamp --options=runtime
81+
82+
/usr/bin/codesign -dv --verbose=4 plugins/python-processor.bundle
83+
84+
# Store the notarization credentials so that we can prevent a UI password dialog from blocking the CI
85+
86+
echo "Create keychain profile"
87+
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"
88+
89+
# We can't notarize an app bundle directly, but we need to compress it as an archive.
90+
# Therefore, we create a zip file containing our app bundle, so that we can send it to the
91+
# notarization service
92+
93+
echo "Creating temp notarization archive"
94+
/usr/bin/ditto -c -k --sequesterRsrc --keepParent plugins/python-processor.bundle python-processor.zip
95+
96+
# Here we send the notarization request to the Apple's Notarization service, waiting for the result.
97+
# This typically takes a few seconds inside a CI environment, but it might take more depending on the App
98+
# characteristics. Visit the Notarization docs for more information and strategies on how to optimize it if
99+
# you're curious
100+
101+
echo "Notarize app"
102+
xcrun notarytool submit "python-processor.zip" --keychain-profile "notarytool-profile" --wait
103+
104+
# Finally, we need to "attach the staple" to our executable, which will allow our app to be
105+
# validated by macOS even when an internet connection is not available.
106+
echo "Attach staple"
107+
rm -r plugins/*
108+
/usr/bin/ditto -x -k python-processor.zip plugins
109+
xcrun stapler staple plugins/python-processor.bundle
110+
47111
zipfile=${package}_${new_plugin_ver}.zip
48112
echo "zipfile=${zipfile}" >> $GITHUB_ENV
49113
zip -r -X $zipfile plugins shared
@@ -52,7 +116,7 @@ jobs:
52116
name: ${{ env.zipfile }}
53117
path: ${{ env.zipfile }}
54118
- name: deploy
55-
if: github.ref == 'refs/heads/main'
119+
if: github.ref == 'refs/heads/testing-juce8'
56120
env:
57121
artifactoryApiKey: ${{ secrets.artifactoryApiKey }}
58122
run: |

.github/workflows/windows.yml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,44 @@ 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@v3
16+
- uses: actions/checkout@v4
1717
with:
1818
submodules: true
19-
- uses: conda-incubator/setup-miniconda@v2
19+
- name: set env vars
20+
run: |
21+
if [ ${{github.ref_name}} == 'juce8' ]; then
22+
echo "GUI_BRANCH=development-juce8" >> "$GITHUB_ENV"
23+
echo "GUI_LIB_VERSION=v1.0.0-dev" >> "$GITHUB_ENV"
24+
elif [ ${{github.ref_name}} == 'testing-juce8' ]; then
25+
echo "GUI_BRANCH=testing-juce8" >> "$GITHUB_ENV"
26+
echo "GUI_LIB_VERSION=v1.0.0-alpha" >> "$GITHUB_ENV"
27+
else
28+
echo "Invalid branch : ${{github.ref_name}}"
29+
exit 1
30+
fi
31+
shell: bash
32+
- uses: conda-incubator/setup-miniconda@v3
2033
with:
2134
activate-environment: oe-python-plugin
2235
python-version: "3.10"
2336
auto-activate-base: false
2437
- name: setup
25-
env:
26-
repo: open-ephys-gui
27-
package: "open-ephys-lib"
2838
run: |
2939
cd ../..
30-
git clone https://github.com/open-ephys/plugin-GUI.git --branch main
40+
git clone https://github.com/open-ephys/plugin-GUI.git --branch $GUI_BRANCH
3141
cd plugin-GUI/Build
32-
cmake -G "Visual Studio 16 2019" -A x64 ..
42+
cmake -G "Visual Studio 17 2022" -A x64 ..
3343
mkdir Release && cd Release
34-
curl -L https://openephysgui.jfrog.io/artifactory/Libraries/open-ephys-lib-v0.6.0.zip --output open-ephys-lib.zip
44+
curl -L https://openephysgui.jfrog.io/artifactory/Libraries/open-ephys-lib-$GUI_LIB_VERSION.zip --output open-ephys-lib.zip
3545
unzip open-ephys-lib.zip
3646
shell: bash
3747
- name: configure
3848
run: |
3949
cd Build
40-
cmake -G "Visual Studio 16 2019" -A x64 -DPython_ROOT_DIR="$CONDA/envs/oe-python-plugin" -DCOPY_PYTHON_DL=ON ..
50+
cmake -G "Visual Studio 17 2022" -A x64 -DPython_ROOT_DIR="$CONDA/envs/oe-python-plugin" -DCOPY_PYTHON_DL=ON ..
4151
shell: bash
4252
- name: Add msbuild to PATH
4353
uses: microsoft/[email protected]
@@ -70,7 +80,7 @@ jobs:
7080
name: ${{ env.zipfile }}
7181
path: ${{ env.zipfile }}
7282
- name: deploy
73-
if: github.ref == 'refs/heads/main'
83+
if: github.ref == 'refs/heads/testing-juce8'
7484
env:
7585
artifactoryApiKey: ${{ secrets.artifactoryApiKey }}
7686
run: |

0 commit comments

Comments
 (0)