Skip to content

Commit 7b9b5b0

Browse files
committed
Update GHA workflows
1 parent 7b8603c commit 7b9b5b0

3 files changed

Lines changed: 212 additions & 233 deletions

File tree

.github/workflows/linux.yml

Lines changed: 48 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,48 @@
1-
name: linux
2-
3-
on:
4-
push:
5-
6-
jobs:
7-
8-
build-linux:
9-
10-
runs-on: ${{ matrix.os }}
11-
strategy:
12-
matrix:
13-
os: [ubuntu-22.04]
14-
15-
steps:
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
27-
- name: setup
28-
run: |
29-
sudo apt update
30-
cd ../..
31-
git clone https://github.com/open-ephys/plugin-GUI.git --branch $GUI_BRANCH
32-
sudo ./plugin-GUI/Resources/Scripts/install_linux_dependencies.sh
33-
cd plugin-GUI/Build && cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
34-
- name: build
35-
run: |
36-
cd Build
37-
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
38-
make
39-
# - name: test
40-
# run: cd build && ctest
41-
- name: deploy
42-
if: github.ref == 'refs/heads/testing-juce8'
43-
env:
44-
ARTIFACTORY_ACCESS_TOKEN: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
45-
build_dir: "Build"
46-
package: SourceSim-linux
47-
run: |
48-
plugin_api=$(grep -rnw ../../plugin-GUI/Source -e '#define PLUGIN_API_VER' | grep -Eo "[0-9]*" | tail -1)
49-
tag=$(grep -w Source/OpenEphysLib.cpp -e 'info->libVersion' | grep -Eo "[0-9]+.[0-9]+.[0-9]+")
50-
new_plugin_ver=$tag-API$plugin_api
51-
mkdir plugins
52-
cp -r $build_dir/*.so plugins
53-
zipfile=${package}_${new_plugin_ver}.zip
54-
zip -r -X $zipfile plugins
55-
curl -H "X-JFrog-Art-Api:$ARTIFACTORY_ACCESS_TOKEN" -T $zipfile "https://openephys.jfrog.io/artifactory/SourceSim-plugin/linux/$zipfile"
1+
name: linux
2+
3+
on:
4+
push:
5+
branches:
6+
- '**' # Runs on push to any branch
7+
pull_request:
8+
branches:
9+
- main # Runs on pull requests targeting the main branch
10+
11+
jobs:
12+
13+
build-linux:
14+
15+
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.base_ref == 'main')
16+
runs-on: ubuntu-22.04
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: setup
21+
run: |
22+
sudo apt update
23+
cd ../..
24+
git clone https://github.com/open-ephys/plugin-GUI.git --branch main
25+
sudo ./plugin-GUI/Resources/Scripts/install_linux_dependencies.sh
26+
cd plugin-GUI/Build && cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
27+
- name: build
28+
run: |
29+
cd Build
30+
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
31+
make
32+
# - name: test
33+
# run: cd build && ctest
34+
- name: deploy
35+
if: github.ref == 'refs/heads/main'
36+
env:
37+
ARTIFACTORY_ACCESS_TOKEN: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
38+
build_dir: "Build"
39+
package: SourceSim-linux
40+
run: |
41+
plugin_api=$(grep -rnw ../../plugin-GUI/Source -e '#define PLUGIN_API_VER' | grep -Eo "[0-9]*" | tail -1)
42+
tag=$(grep -w Source/OpenEphysLib.cpp -e 'info->libVersion' | grep -Eo "[0-9]+.[0-9]+.[0-9]+")
43+
new_plugin_ver=$tag-API$plugin_api
44+
mkdir plugins
45+
cp -r $build_dir/*.so plugins
46+
zipfile=${package}_${new_plugin_ver}.zip
47+
zip -r -X $zipfile plugins
48+
curl -H "X-JFrog-Art-Api:$ARTIFACTORY_ACCESS_TOKEN" -T $zipfile "https://openephys.jfrog.io/artifactory/SourceSim-plugin/linux/$zipfile"

.github/workflows/mac.yml

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

0 commit comments

Comments
 (0)