Skip to content

Commit 77017bb

Browse files
committed
Refactor GitHub Actions workflows
1 parent 4274556 commit 77017bb

File tree

3 files changed

+45
-65
lines changed

3 files changed

+45
-65
lines changed

.github/workflows/linux.yml

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,34 @@
11
name: linux
22

3-
on:
3+
on:
44
push:
5+
branches:
6+
- '**' # Runs on push to any branch
7+
tags:
8+
- '*' # Runs on any tag push
9+
pull_request:
10+
branches:
11+
- main # Runs on pull requests targeting the main branch
512

613
jobs:
714

815
build-linux:
916

10-
runs-on: ${{ matrix.os }}
11-
strategy:
12-
matrix:
13-
os: [ubuntu-20.04]
17+
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.base_ref == 'main')
18+
runs-on: ubuntu-22.04
1419

1520
steps:
1621
- uses: actions/checkout@v4
1722
with:
1823
submodules: true
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
2924
- uses: actions/setup-python@v5
3025
with:
31-
python-version: '3.12'
26+
python-version: '3.10'
3227
- name: setup
3328
run: |
3429
sudo apt update
3530
cd ../..
36-
git clone https://github.com/open-ephys/plugin-GUI.git --branch $GUI_BRANCH
31+
git clone https://github.com/open-ephys/plugin-GUI.git --branch main --single-branch
3732
sudo ./plugin-GUI/Resources/Scripts/install_linux_dependencies.sh
3833
cd plugin-GUI/Build && cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
3934
- name: build
@@ -63,7 +58,7 @@ jobs:
6358
name: ${{ env.zipfile }}
6459
path: ${{ env.zipfile }}
6560
- name: deploy
66-
if: github.ref == 'refs/heads/testing-juce8'
61+
if: github.ref == 'refs/heads/main'
6762
env:
6863
secrets.ARTIFACTORY_ACCESS_TOKEN: ${{ secrets.secrets.ARTIFACTORY_ACCESS_TOKEN }}
6964
run: |

.github/workflows/mac.yml

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,33 @@
11
name: mac
22

3-
on:
3+
on:
44
push:
5+
branches:
6+
- '**' # Runs on push to any branch
7+
tags:
8+
- '*' # Runs on any tag push
9+
pull_request:
10+
branches:
11+
- main # Runs on pull requests targeting the main branch
512

613
jobs:
714

815
build-mac:
916

10-
runs-on: ${{ matrix.os }}
11-
strategy:
12-
matrix:
13-
os: [macos-latest]
17+
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.base_ref == 'main')
18+
runs-on: macos-latest
1419

1520
steps:
1621
- uses: actions/checkout@v4
1722
with:
1823
submodules: true
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
3224
- uses: actions/setup-python@v5
3325
with:
34-
python-version: '3.12'
26+
python-version: '3.10'
3527
- name: setup
3628
run: |
3729
cd ../..
38-
git clone https://github.com/open-ephys/plugin-GUI.git --branch $GUI_BRANCH
30+
git clone https://github.com/open-ephys/plugin-GUI.git --branch main --single-branch
3931
cd plugin-GUI/Build && cmake -G "Xcode" ..
4032
- name: build
4133
run: |
@@ -56,7 +48,7 @@ jobs:
5648
build_dir: "Build/Release"
5749
package: PythonProcessor-mac
5850
run: |
59-
plugin_api=$(grep -rnw ../../plugin-GUI/Source -e '#define PLUGIN_API_VER' | grep -Eo "[0-9]" | tail -1)
51+
plugin_api=$(grep -rnw ../../plugin-GUI/Source -e '#define PLUGIN_API_VER' | grep -Eo "[0-9]*" | tail -1)
6052
tag=$(grep -w Source/OpenEphysLib.cpp -e 'info->libVersion' | grep -Eo "[0-9]+.[0-9]+.[0-9]+")
6153
new_plugin_ver=$tag-API$plugin_api
6254
mkdir plugins
@@ -75,7 +67,7 @@ jobs:
7567
security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
7668
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $MACOS_CI_KEYCHAIN_PWD build.keychain
7769
/usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" -v plugins/python-processor.bundle --deep --strict --timestamp --options=runtime
78-
/usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" -v shared/libpython3.12.dylib --deep --strict --timestamp --options=runtime
70+
/usr/bin/codesign --force -s "$MACOS_CERTIFICATE_NAME" -v shared/libpython3.10.dylib --deep --strict --timestamp --options=runtime
7971
8072
/usr/bin/codesign -dv --verbose=4 plugins/python-processor.bundle
8173
@@ -108,13 +100,15 @@ jobs:
108100
109101
zipfile=${package}_${new_plugin_ver}.zip
110102
echo "zipfile=${zipfile}" >> $GITHUB_ENV
111-
zip -r -X $zipfile plugins shared
103+
mkdir temp_dir
104+
cp -R plugins shared temp_dir
105+
/usr/bin/ditto -c -k --sequesterRsrc temp_dir $zipfile
112106
- uses: actions/upload-artifact@v4
113107
with:
114108
name: ${{ env.zipfile }}
115109
path: ${{ env.zipfile }}
116110
- name: deploy
117-
if: github.ref == 'refs/heads/testing-juce8'
111+
if: github.ref == 'refs/heads/main'
118112
env:
119113
secrets.ARTIFACTORY_ACCESS_TOKEN: ${{ secrets.secrets.ARTIFACTORY_ACCESS_TOKEN }}
120114
run: |

.github/workflows/windows.yml

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,36 @@
11
name: Windows
22

3-
on:
3+
on:
44
push:
5+
branches:
6+
- '**' # Runs on push to any branch
7+
tags:
8+
- '*' # Runs on any tag push
9+
pull_request:
10+
branches:
11+
- main # Runs on pull requests targeting the main branch
512

613
jobs:
714

815
build-windows:
9-
10-
runs-on: ${{ matrix.os }}
11-
strategy:
12-
matrix:
13-
os: [windows-latest]
16+
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.base_ref == 'main')
17+
runs-on: windows-latest
1418

1519
steps:
1620
- uses: actions/checkout@v4
1721
with:
1822
submodules: true
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
3223
- uses: actions/setup-python@v5
3324
with:
34-
python-version: '3.12'
25+
python-version: '3.10'
3526
- name: setup
3627
run: |
3728
cd ../..
38-
git clone https://github.com/open-ephys/plugin-GUI.git --branch $GUI_BRANCH
29+
git clone https://github.com/open-ephys/plugin-GUI.git --branch main --single-branch
3930
cd plugin-GUI/Build
4031
cmake -G "Visual Studio 17 2022" -A x64 ..
4132
mkdir Release && cd Release
42-
curl -L https://openephys.jfrog.io/artifactory/GUI-binaries/Libraries/open-ephys-lib-$GUI_LIB_VERSION.zip --output open-ephys-lib.zip
33+
curl -L https://openephys.jfrog.io/artifactory/GUI-binaries/Libraries/open-ephys-lib-v1.0.0.zip --output open-ephys-lib.zip
4334
unzip open-ephys-lib.zip
4435
shell: bash
4536
- name: configure
@@ -78,7 +69,7 @@ jobs:
7869
name: ${{ env.zipfile }}
7970
path: ${{ env.zipfile }}
8071
- name: deploy
81-
if: github.ref == 'refs/heads/testing-juce8'
72+
if: github.ref == 'refs/heads/main'
8273
env:
8374
secrets.ARTIFACTORY_ACCESS_TOKEN: ${{ secrets.secrets.ARTIFACTORY_ACCESS_TOKEN }}
8475
run: |

0 commit comments

Comments
 (0)