Skip to content

Commit

Permalink
Update GHA workflows
Browse files Browse the repository at this point in the history
- Add codesigning for macOS
- Deploy on push to juce8 branch
  • Loading branch information
anjaldoshi committed Jun 25, 2024
1 parent 63860d2 commit f2a62b6
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 11 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ jobs:
os: [ubuntu-20.04]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: setup
run: |
sudo apt update
cd ../..
git clone https://github.com/open-ephys/plugin-GUI.git --branch main
git clone https://github.com/open-ephys/plugin-GUI.git --branch development-juce8
sudo ./plugin-GUI/Resources/Scripts/install_linux_dependencies.sh
cd plugin-GUI/Build && cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
- name: build
Expand All @@ -29,7 +31,7 @@ jobs:
# - name: test
# run: cd build && ctest
- name: deploy
if: github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/juce8'
env:
artifactoryApiKey: ${{ secrets.artifactoryApiKey }}
build_dir: "Build"
Expand Down
71 changes: 67 additions & 4 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@ jobs:
os: [macos-latest]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: setup
run: |
cd ../..
git clone https://github.com/open-ephys/plugin-GUI.git --branch main
git clone https://github.com/open-ephys/plugin-GUI.git --branch development-juce8
cd plugin-GUI/Build && cmake -G "Xcode" ..
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: build
run: |
cd Build
Expand All @@ -27,9 +32,16 @@ jobs:
# - name: test
# run: cd build && ctest
- name: deploy
if: github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/juce8'
env:
artifactoryApiKey: ${{ secrets.artifactoryApiKey }}
MACOS_CERTIFICATE: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
MACOS_CERTIFICATE_PWD: ${{ secrets.BUILD_CERTIFICATE_PWD }}
MACOS_CERTIFICATE_NAME: ${{ secrets.BUILD_CERTIFICATE_NAME }}
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}
PROD_MACOS_NOTARIZATION_APPLE_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_APPLE_ID }}
PROD_MACOS_NOTARIZATION_TEAM_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}
PROD_MACOS_NOTARIZATION_PWD: ${{ secrets.PROD_MACOS_NOTARIZATION_PWD }}
build_dir: "Build/Release"
package: OpenEphysHDF5Lib-mac
run: |
Expand All @@ -39,6 +51,57 @@ jobs:
mkdir shared
cp -r $build_dir/*.dylib shared
cp -r libs/macos/bin/* shared
# Turn our base64-encoded certificate back to a regular .p12 file
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
# We need to create a new keychain, otherwise using the certificate will prompt
# with a UI dialog asking for the certificate password, which we can't
# use in a headless CI environment
security create-keychain -p $MACOS_CI_KEYCHAIN_PWD build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p $MACOS_CI_KEYCHAIN_PWD build.keychain
security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $MACOS_CI_KEYCHAIN_PWD build.keychain
/usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" -v shared/libOpenEphysHDF5.dylib --deep --strict --timestamp --options=runtime
/usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" -v shared/libhdf5_cpp.310.dylib --deep --strict --timestamp --options=runtime
/usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" -v shared/libhdf5.310.dylib --deep --strict --timestamp --options=runtime
/usr/bin/codesign -dv --verbose=4 shared/libOpenEphysHDF5.dylib
# Store the notarization credentials so that we can prevent a UI password dialog from blocking the CI
echo "Create keychain profile"
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"
# We can't notarize an app bundle directly, but we need to compress it as an archive.
# Therefore, we create a zip file containing our app bundle, so that we can send it to the
# notarization service
echo "Creating temp notarization archive"
zip -R OpenEphysHDF5Lib.zip shared/*.dylib
# Here we send the notarization request to the Apple's Notarization service, waiting for the result.
# This typically takes a few seconds inside a CI environment, but it might take more depending on the App
# characteristics. Visit the Notarization docs for more information and strategies on how to optimize it if
# you're curious
echo "Notarize app"
xcrun notarytool submit "OpenEphysHDF5Lib.zip" --keychain-profile "notarytool-profile" --wait
# Finally, we need to "attach the staple" to our executable, which will allow our app to be
# validated by macOS even when an internet connection is not available.
echo "Attach staple"
rm -r shared/*
unzip OpenEphysHDF5Lib.zip
ls shared
xcrun stapler staple shared/libOpenEphysHDF5.dylib
xcrun stapler staple shared/libhdf5_cpp.310.dylib
xcrun stapler staple shared/libhdf5.310.dylib
spctl -vvv --assess --type exec shared/libOpenEphysHDF5.dylib
zipfile=${package}_${new_plugin_ver}.zip
zip -r -X $zipfile shared
/usr/bin/ditto -c -k --sequesterRsrc --keepParent shared $zipfile
curl -H "X-JFrog-Art-Api:$artifactoryApiKey" -T $zipfile "https://openephys.jfrog.io/artifactory/OpenEphysHDF5Lib-plugin/mac/$zipfile"
10 changes: 6 additions & 4 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,20 @@ jobs:
os: [windows-2019]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: setup
env:
repo: open-ephys-gui
package: "open-ephys-lib"
run: |
cd ../..
git clone https://github.com/open-ephys/plugin-GUI.git --branch main
git clone https://github.com/open-ephys/plugin-GUI.git --branch development-juce8
cd plugin-GUI/Build
cmake -G "Visual Studio 16 2019" -A x64 ..
mkdir Release && cd Release
curl -L https://openephysgui.jfrog.io/artifactory/Libraries/open-ephys-lib-v0.6.0.zip --output open-ephys-lib.zip
curl -L https://openephysgui.jfrog.io/artifactory/Libraries/open-ephys-lib-v0.7.0.zip --output open-ephys-lib.zip
unzip open-ephys-lib.zip
shell: bash
- name: configure
Expand All @@ -42,7 +44,7 @@ jobs:
# - name: test
# run: cd build && ctest
- name: deploy
if: github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/juce8'
env:
artifactoryApiKey: ${{ secrets.artifactoryApiKey }}
build_dir: "Build/Release"
Expand Down

0 comments on commit f2a62b6

Please sign in to comment.