Skip to content

Commit a0fda71

Browse files
committed
Add GHA workflows for Windows & macOS
1 parent 740cb7c commit a0fda71

File tree

2 files changed

+133
-0
lines changed

2 files changed

+133
-0
lines changed

.github/workflows/mac.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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@v3
17+
with:
18+
submodules: true
19+
- uses: conda-incubator/setup-miniconda@v2
20+
with:
21+
activate-environment: oe-python-plugin
22+
python-version: "3.10"
23+
auto-activate-base: false
24+
- name: setup
25+
run: |
26+
cd ../..
27+
git clone https://github.com/open-ephys/plugin-GUI.git --branch main
28+
cd plugin-GUI/Build && cmake -G "Xcode" ..
29+
- name: build
30+
run: |
31+
cd Build
32+
cmake -G "Xcode" -DPython_ROOT_DIR="$CONDA/envs/oe-python-plugin" -DCOPY_PYTHON_DL=ON ..
33+
xcodebuild -configuration Release
34+
# - name: test
35+
# run: cd build && ctest
36+
- name: package
37+
env:
38+
build_dir: "Build/Release"
39+
package: PythonProcessor-mac
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/*.bundle plugins
46+
echo "zipfile=${package}_${new_plugin_ver}.zip" >> $GITHUB_ENV
47+
zip -r -X ${{ env.zipfile }} plugins $build_dir/shared
48+
- uses: actions/upload-artifact@v3
49+
with:
50+
name: ${{ env.zipfile }}
51+
path: ${{ env.zipfile }}
52+
- name: deploy
53+
if: github.ref == 'refs/heads/main'
54+
env:
55+
artifactoryApiKey: ${{ secrets.artifactoryApiKey }}
56+
run: |
57+
curl -H "X-JFrog-Art-Api:$artifactoryApiKey" -T ${{ env.zipfile }} "https://openephys.jfrog.io/artifactory/PythonProcessor-plugin/mac/${{ env.zipfile }}"

.github/workflows/windows.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Windows
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
8+
build-windows:
9+
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
os: [windows-2019]
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
with:
18+
submodules: true
19+
- uses: conda-incubator/setup-miniconda@v2
20+
with:
21+
activate-environment: oe-python-plugin
22+
python-version: "3.10"
23+
auto-activate-base: false
24+
- name: setup
25+
env:
26+
repo: open-ephys-gui
27+
package: "open-ephys-lib"
28+
run: |
29+
cd ../..
30+
git clone https://github.com/open-ephys/plugin-GUI.git --branch main
31+
cd plugin-GUI/Build
32+
cmake -G "Visual Studio 16 2019" -A x64 ..
33+
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
35+
unzip open-ephys-lib.zip
36+
shell: bash
37+
- name: configure
38+
run: |
39+
cd Build
40+
cmake -G "Visual Studio 16 2019" -A x64 -DPython_ROOT_DIR="$CONDA/envs/oe-python-plugin" -DCOPY_PYTHON_DL=ON ..
41+
shell: bash
42+
- name: Add msbuild to PATH
43+
uses: microsoft/setup-msbuild@v1.1
44+
- name: build-plugin
45+
run: |
46+
cd Build
47+
msbuild INSTALL.vcxproj -p:Configuration=Release -p:Platform=x64
48+
shell: cmd
49+
# TODO: Perform some basic testing before publishing...
50+
# - name: test
51+
# run: cd build && ctest
52+
- name: package
53+
env:
54+
build_dir: "Build/Release"
55+
package: PythonProcessor-windows
56+
run: |
57+
plugin_api=$(grep -rnw ../../plugin-GUI/Source -e '#define PLUGIN_API_VER' | grep -Eo "[0-9]*" | tail -1)
58+
tag=$(grep -w Source/OpenEphysLib.cpp -e 'info->libVersion' | grep -Eo "[0-9]+.[0-9]+.[0-9]+")
59+
new_plugin_ver=$tag-API$plugin_api
60+
mkdir plugins
61+
cp $build_dir/*.dll plugins
62+
echo "zipfile=${package}_${new_plugin_ver}.zip" >> $GITHUB_ENV
63+
powershell Compress-Archive -Path "plugins" -DestinationPath ${{ env.zipfile }}
64+
powershell Compress-Archive -U -Path "$build_dir/shared" -DestinationPath ${{ env.zipfile }}
65+
shell: bash
66+
- uses: actions/upload-artifact@v3
67+
with:
68+
name: ${{ env.zipfile }}
69+
path: ${{ env.zipfile }}
70+
- name: deploy
71+
if: github.ref == 'refs/heads/main'
72+
env:
73+
artifactoryApiKey: ${{ secrets.artifactoryApiKey }}
74+
run: |
75+
curl -H "X-JFrog-Art-Api:$artifactoryApiKey" -T ${{ env.zipfile }} "https://openephys.jfrog.io/artifactory/PythonProcessor-plugin/windows/${{ env.zipfile }}"
76+
shell: bash

0 commit comments

Comments
 (0)