Skip to content

Commit 9d677da

Browse files
committed
Update CI workflows for Linux, macOS, and Windows to enhance deployment logic and versioning
1 parent ce48ab0 commit 9d677da

File tree

3 files changed

+83
-120
lines changed

3 files changed

+83
-120
lines changed

.github/workflows/linux.yml

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ on:
1111
- 'Source/**'
1212
- 'CMakeLists.txt'
1313
- 'HelperFunctions.cmake'
14+
pull_request:
15+
paths:
16+
- '.github/workflows/**'
17+
- 'JuceLibraryCode/**'
18+
- 'PluginGenerator/**'
19+
- 'Plugins/**'
20+
- 'Resources/**'
21+
- 'Source/**'
22+
- 'CMakeLists.txt'
23+
- 'HelperFunctions.cmake'
1424

1525
jobs:
1626
build-ubuntu:
@@ -31,43 +41,41 @@ jobs:
3141
sudo ./install_linux_dependencies.sh
3242
cd ../../Build && cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
3343
make -j4
34-
# - name: test
35-
# run: cd build && ctest
36-
- name: deploy_dev
37-
if: github.ref == 'refs/heads/development-juce8'
44+
- name: deploy
3845
env:
3946
ARTIFACTORY_ACCESS_TOKEN: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
4047
run: |
41-
cd Build
42-
cp -r Release open-ephys
43-
cp ../LICENSE open-ephys
44-
zipfile=open-ephys-v1.0.0-dev-linux.zip
45-
zip -r $zipfile open-ephys
46-
user_info="X-JFrog-Art-Api:$ARTIFACTORY_ACCESS_TOKEN"
47-
curl -H $user_info -T $zipfile "https://openephys.jfrog.io/artifactory/GUI-binaries/1.0.0-dev/linux/$zipfile"
48-
shell: bash
49-
- name: deploy_preview
50-
if: github.ref == 'refs/heads/testing-juce8'
51-
env:
52-
ARTIFACTORY_ACCESS_TOKEN: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
53-
run: |
54-
gui_ver=$(git describe --tags $(git rev-list --tags --max-count=1))
48+
gui_ver=$(grep -w CMakeLists.txt -e 'GUI_VERSION' | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+(-([0-9A-Za-z\.-]+))?")
49+
50+
if [ ${{github.ref_name}} == 'development' ]; then
51+
version_suffix=-dev
52+
artifactory_repo=Dev
53+
gui_ver=latest
54+
elif [ ${{github.ref_name}} == 'testing' ]; then
55+
version_suffix=-beta
56+
artifactory_repo=Test
57+
elif [ ${{github.ref_name}} == 'main' ]; then
58+
artifactory_repo=Release
59+
else
60+
echo "This branch is not configured for deployment."
61+
exit 0
62+
fi
5563
5664
cd Build
5765
cp -r Release open-ephys
5866
cp ../LICENSE open-ephys
59-
zipfile=open-ephys-v1.0.0-alpha.1-linux.zip
67+
zipfile=open-ephys-${gui_ver}-linux${version_suffix}.zip
6068
zip -r $zipfile open-ephys
6169
user_info="X-JFrog-Art-Api:$ARTIFACTORY_ACCESS_TOKEN"
62-
curl -H $user_info -T $zipfile "https://openephys.jfrog.io/artifactory/GUI-binaries/1.0.0-alpha/linux/$zipfile"
70+
curl -H $user_info -T $zipfile "https://openephys.jfrog.io/artifactory/GUI-binaries/${artifactory_repo}/linux/$zipfile"
6371
6472
cd ../Resources/Installers/Linux/Open-Ephys_Installer
6573
mkdir -p usr/local/bin/open-ephys-gui
6674
cp -r ../../../../Build/Release/* usr/local/bin/open-ephys-gui
67-
cp ../../../Scripts/40-open-ephys.rules usr/local/bin/open-ephys-gui
75+
cp ../../../Scripts/*.rules usr/local/bin/open-ephys-gui
6876
cd ..
6977
dpkg-deb --build Open-Ephys_Installer
70-
installer=open-ephys-gui-v1.0.0-alpha.1.deb
78+
installer=open-ephys-gui-${gui_ver}${version_suffix}.deb
7179
mv -v Open-Ephys_Installer.deb $installer
72-
curl -H $user_info -T $installer "https://openephys.jfrog.io/artifactory/GUI-binaries/1.0.0-alpha/linux/$installer"
80+
curl -H $user_info -T $installer "https://openephys.jfrog.io/artifactory/GUI-binaries/${artifactory_repo}-Installer/linux/$installer"
7381
shell: bash

.github/workflows/osx.yml

Lines changed: 30 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ on:
1111
- 'Source/**'
1212
- 'CMakeLists.txt'
1313
- 'HelperFunctions.cmake'
14+
pull_request:
15+
paths:
16+
- '.github/workflows/**'
17+
- 'JuceLibraryCode/**'
18+
- 'PluginGenerator/**'
19+
- 'Plugins/**'
20+
- 'Resources/**'
21+
- 'Source/**'
22+
- 'CMakeLists.txt'
23+
- 'HelperFunctions.cmake'
1424

1525
jobs:
1626
build-osx:
@@ -32,10 +42,7 @@ jobs:
3242
run: |
3343
cd Build
3444
xcodebuild -configuration Release
35-
# - name: test
36-
# run: cd build && ctest
37-
- name: deploy_dev
38-
if: github.ref == 'refs/heads/development-juce8'
45+
- name: deploy
3946
env:
4047
ARTIFACTORY_ACCESS_TOKEN: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
4148
MACOS_CERTIFICATE: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
@@ -46,68 +53,22 @@ jobs:
4653
PROD_MACOS_NOTARIZATION_TEAM_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}
4754
PROD_MACOS_NOTARIZATION_PWD: ${{ secrets.PROD_MACOS_NOTARIZATION_PWD }}
4855
run: |
49-
cd Build/Release
50-
mkdir open-ephys
51-
mv Open\ Ephys\ GUI.app open-ephys
52-
53-
# Turn our base64-encoded certificate back to a regular .p12 file
54-
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
55-
56-
# We need to create a new keychain, otherwise using the certificate will prompt
57-
# with a UI dialog asking for the certificate password, which we can't
58-
# use in a headless CI environment
59-
security create-keychain -p $MACOS_CI_KEYCHAIN_PWD build.keychain
60-
security default-keychain -s build.keychain
61-
security unlock-keychain -p $MACOS_CI_KEYCHAIN_PWD build.keychain
62-
security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
63-
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $MACOS_CI_KEYCHAIN_PWD build.keychain
64-
/usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" -v open-ephys/Open\ Ephys\ GUI.app --deep --strict --timestamp --options=runtime --entitlements ../../Resources/Build-files/entitlements.plist
65-
66-
/usr/bin/codesign -dv --verbose=4 --entitlements - open-ephys/Open\ Ephys\ GUI.app
67-
68-
# Store the notarization credentials so that we can prevent a UI password dialog from blocking the CI
69-
70-
echo "Create keychain profile"
71-
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"
72-
73-
# We can't notarize an app bundle directly, but we need to compress it as an archive.
74-
# Therefore, we create a zip file containing our app bundle, so that we can send it to the
75-
# notarization service
56+
gui_ver=$(grep -w CMakeLists.txt -e 'GUI_VERSION' | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+(-([0-9A-Za-z\.-]+))?")
57+
58+
if [ ${{github.ref_name}} == 'development' ]; then
59+
version_suffix=-dev
60+
artifactory_repo=Dev
61+
gui_ver=latest
62+
elif [ ${{github.ref_name}} == 'testing' ]; then
63+
version_suffix=-beta
64+
artifactory_repo=Test
65+
elif [ ${{github.ref_name}} == 'main' ]; then
66+
artifactory_repo=Release
67+
else
68+
echo "This branch is not configured for deployment."
69+
exit 0
70+
fi
7671
77-
echo "Creating temp notarization archive"
78-
/usr/bin/ditto -c -k --sequesterRsrc --keepParent open-ephys/Open\ Ephys\ GUI.app open-ephys.zip
79-
80-
# Here we send the notarization request to the Apple's Notarization service, waiting for the result.
81-
# This typically takes a few seconds inside a CI environment, but it might take more depending on the App
82-
# characteristics. Visit the Notarization docs for more information and strategies on how to optimize it if
83-
# you're curious
84-
85-
echo "Notarize app"
86-
xcrun notarytool submit "open-ephys.zip" --keychain-profile "notarytool-profile" --wait
87-
88-
# Finally, we need to "attach the staple" to our executable, which will allow our app to be
89-
# validated by macOS even when an internet connection is not available.
90-
echo "Attach staple"
91-
rm -r open-ephys/*
92-
/usr/bin/ditto -x -k open-ephys.zip open-ephys
93-
xcrun stapler staple open-ephys/Open\ Ephys\ GUI.app
94-
95-
zipfile=open-ephys-v1.0.0-dev-mac.zip
96-
/usr/bin/ditto -c -k --sequesterRsrc --keepParent open-ephys $zipfile
97-
user_info="X-JFrog-Art-Api:$ARTIFACTORY_ACCESS_TOKEN"
98-
curl -H $user_info -T $zipfile "https://openephys.jfrog.io/artifactory/GUI-binaries/1.0.0-dev/mac/$zipfile"
99-
- name: deploy_preview
100-
if: github.ref == 'refs/heads/testing-juce8'
101-
env:
102-
ARTIFACTORY_ACCESS_TOKEN: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
103-
MACOS_CERTIFICATE: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
104-
MACOS_CERTIFICATE_PWD: ${{ secrets.BUILD_CERTIFICATE_PWD }}
105-
MACOS_CERTIFICATE_NAME: ${{ secrets.BUILD_CERTIFICATE_NAME }}
106-
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}
107-
PROD_MACOS_NOTARIZATION_APPLE_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_APPLE_ID }}
108-
PROD_MACOS_NOTARIZATION_TEAM_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}
109-
PROD_MACOS_NOTARIZATION_PWD: ${{ secrets.PROD_MACOS_NOTARIZATION_PWD }}
110-
run: |
11172
cd Build/Release
11273
mkdir open-ephys
11374
mv Open\ Ephys\ GUI.app open-ephys
@@ -154,10 +115,10 @@ jobs:
154115
/usr/bin/ditto -x -k open-ephys.zip open-ephys
155116
xcrun stapler staple open-ephys/Open\ Ephys\ GUI.app
156117
157-
zipfile=open-ephys-v1.0.0-alpha.1-mac.zip
118+
zipfile=open-ephys-${gui_ver}-mac${version_suffix}.zip
158119
/usr/bin/ditto -c -k --sequesterRsrc --keepParent open-ephys $zipfile
159120
user_info="X-JFrog-Art-Api:$ARTIFACTORY_ACCESS_TOKEN"
160-
curl -H $user_info -T $zipfile "https://openephys.jfrog.io/artifactory/GUI-binaries/1.0.0-alpha/mac/$zipfile"
121+
curl -H $user_info -T $zipfile "https://openephys.jfrog.io/artifactory/GUI-binaries/${artifactory_repo}/mac/$zipfile"
161122
162123
# Create a DMG installer
163124
brew install create-dmg && create-dmg \
@@ -173,7 +134,7 @@ jobs:
173134
"Open-Ephys-Installer.dmg" \
174135
"open-ephys/"
175136
176-
installer=Open_Ephys_GUI_v1.0.0-alpha.1.dmg
137+
installer=Open_Ephys_GUI_${gui_ver}${version_suffix}.dmg
177138
mv -v Open-Ephys-Installer.dmg $installer
178139
179140
echo "Notarize DMG"
@@ -182,4 +143,4 @@ jobs:
182143
echo "Attach staple to DMG"
183144
xcrun stapler staple $installer
184145
185-
curl -H $user_info -T $installer "https://openephys.jfrog.io/artifactory/GUI-binaries/1.0.0-alpha/mac/$installer"
146+
curl -H $user_info -T $installer "https://openephys.jfrog.io/artifactory/GUI-binaries/${artifactory_repo}-Installer/mac/$installer"

.github/workflows/windows.yml

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -33,51 +33,45 @@ jobs:
3333
- name: build
3434
run: |
3535
msbuild Build/ALL_BUILD.vcxproj -p:Configuration=Release -p:Platform=x64 -m
36-
# - name: test
37-
# run: cd build && ctest
38-
- name: deploy_dev
39-
if: github.ref == 'refs/heads/development-juce8'
40-
env:
41-
ARTIFACTORY_ACCESS_TOKEN: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
42-
run: |
43-
cd Build
44-
cp -r Release open-ephys
45-
cp -r ../Resources/DLLs/FrontPanelUSB-DriverOnly-4.5.5.exe open-ephys
46-
cp -r ../Resources/DLLs/FTD3XXDriver_WHQLCertified_1.3.0.8_Installer.exe open-ephys
47-
cp ../LICENSE open-ephys
48-
cp C:/Windows/System32/msvcp140.dll open-ephys
49-
cp C:/Windows/System32/vcruntime140.dll open-ephys
50-
cp C:/Windows/System32/vcruntime140_1.dll open-ephys
51-
gui_ver=$(git describe --tags $(git rev-list --tags --max-count=1))
52-
zipfile=open-ephys-v1.0.0-dev-windows.zip
53-
powershell Compress-Archive -Path "open-ephys" -DestinationPath ${zipfile}
54-
user_info="X-JFrog-Art-Api:$ARTIFACTORY_ACCESS_TOKEN"
55-
curl -H $user_info -T $zipfile "https://openephys.jfrog.io/artifactory/GUI-binaries/1.0.0-dev/windows/$zipfile"
56-
shell: bash
57-
- name: deploy_preview
36+
- name: deploy
5837
if: github.ref == 'refs/heads/testing-juce8'
5938
env:
6039
ARTIFACTORY_ACCESS_TOKEN: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
6140
run: |
41+
gui_ver=$(grep -w CMakeLists.txt -e 'GUI_VERSION' | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+(-([0-9A-Za-z\.-]+))?")
42+
43+
if [ ${{github.ref_name}} == 'development' ]; then
44+
version_suffix=-dev
45+
artifactory_repo=Dev
46+
gui_ver=latest
47+
elif [ ${{github.ref_name}} == 'testing' ]; then
48+
version_suffix=-beta
49+
artifactory_repo=Test
50+
elif [ ${{github.ref_name}} == 'main' ]; then
51+
artifactory_repo=Release
52+
else
53+
echo "This branch is not configured for deployment."
54+
exit 0
55+
fi
56+
6257
cd Build
6358
cp -r Release open-ephys
6459
cp -r ../Resources/DLLs/FrontPanelUSB-DriverOnly-4.5.5.exe open-ephys
65-
cp -r ../Resources/DLLs/FTD3XXDriver_WHQLCertified_1.3.0.8_Installer.exe open-ephys
60+
cp -r ../Resources/DLLs/FTD3XXDriver_WHQLCertified_1.3.0.10_Installer.exe open-ephys
6661
cp ../LICENSE open-ephys
6762
cp C:/Windows/System32/msvcp140.dll open-ephys
6863
cp C:/Windows/System32/vcruntime140.dll open-ephys
6964
cp C:/Windows/System32/vcruntime140_1.dll open-ephys
70-
gui_ver=$(git describe --tags $(git rev-list --tags --max-count=1))
71-
zipfile=open-ephys-v1.0.0-alpha.1-windows.zip
65+
zipfile=open-ephys-${gui_ver}-windows${version_suffix}.zip
7266
powershell Compress-Archive -Path "open-ephys" -DestinationPath ${zipfile}
7367
user_info="X-JFrog-Art-Api:$ARTIFACTORY_ACCESS_TOKEN"
74-
curl -H $user_info -T $zipfile "https://openephys.jfrog.io/artifactory/GUI-binaries/1.0.0-alpha/windows/$zipfile"
68+
curl -H $user_info -T $zipfile "https://openephys.jfrog.io/artifactory/GUI-binaries/${artifactory_repo}/windows/$zipfile"
7569
7670
cd open-ephys
7771
rm -f msvcp140.dll vcruntime140.dll vcruntime140_1.dll
7872
cd ../../Resources/Installers/Windows
7973
iscc "windows_installer_script.iss"
80-
installer=Install-Open-Ephys-GUI-v1.0.0-alpha.1.exe
74+
installer=Install-Open-Ephys-GUI-${gui_ver}${version_suffix}.exe
8175
mv Open-Ephys_Installer.exe $installer
82-
curl -H $user_info -T $installer "https://openephys.jfrog.io/artifactory/GUI-binaries/1.0.0-alpha/windows/$installer"
76+
curl -H $user_info -T $installer "https://openephys.jfrog.io/artifactory/GUI-binaries/${artifactory_repo}-Installer/windows/$installer"
8377
shell: bash

0 commit comments

Comments
 (0)