Skip to content

Commit 1cf5941

Browse files
committed
Refactor GitHub Actions workflows
1 parent ae6601b commit 1cf5941

File tree

3 files changed

+41
-60
lines changed

3 files changed

+41
-60
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-22.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
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
2722
- name: setup
2823
run: |
2924
sudo apt update
3025
cd ../..
31-
git clone https://github.com/open-ephys/plugin-GUI.git --branch $GUI_BRANCH
26+
git clone https://github.com/open-ephys/plugin-GUI.git --branch main
3227
sudo ./plugin-GUI/Resources/Scripts/install_linux_dependencies.sh
3328
cd plugin-GUI/Build && cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ..
3429
cd ../..
3530
mkdir OEPlugins && cd OEPlugins
36-
git clone https://github.com/open-ephys-plugins/OpenEphysFFTW.git --branch ${{github.ref_name}}
31+
git clone https://github.com/open-ephys-plugins/OpenEphysFFTW.git --branch main
3732
cd OpenEphysFFTW/Build
3833
cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Release ..
3934
make install
@@ -45,7 +40,7 @@ jobs:
4540
# - name: test
4641
# run: cd build && ctest
4742
- name: deploy
48-
if: github.ref == 'refs/heads/testing-juce8'
43+
if: github.ref == 'refs/heads/main'
4944
env:
5045
ARTIFACTORY_ACCESS_TOKEN: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
5146
build_dir: "Build"

.github/workflows/mac.yml

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,32 @@
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
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
2722
- name: setup
2823
run: |
2924
cd ../..
30-
git clone https://github.com/open-ephys/plugin-GUI.git --branch $GUI_BRANCH
25+
git clone https://github.com/open-ephys/plugin-GUI.git --branch main
3126
cd plugin-GUI/Build && cmake -G "Xcode" ..
3227
cd ../..
3328
mkdir OEPlugins && cd OEPlugins
34-
git clone https://github.com/open-ephys-plugins/OpenEphysFFTW.git --branch ${{github.ref_name}}
29+
git clone https://github.com/open-ephys-plugins/OpenEphysFFTW.git --branch main
3530
cd OpenEphysFFTW/Build
3631
cmake -G "Xcode" ..
3732
xcodebuild -target install -configuration Release
@@ -43,7 +38,7 @@ jobs:
4338
# - name: test
4439
# run: cd build && ctest
4540
- name: codesign_deploy
46-
if: github.ref == 'refs/heads/testing-juce8'
41+
if: github.ref == 'refs/heads/main'
4742
env:
4843
ARTIFACTORY_ACCESS_TOKEN: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
4944
MACOS_CERTIFICATE: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}

.github/workflows/windows.yml

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,43 @@
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
17-
- name: set env vars
18-
run: |
19-
if [ ${{github.ref_name}} == 'juce8' ]; then
20-
echo "GUI_BRANCH=development-juce8" >> "$GITHUB_ENV"
21-
echo "GUI_LIB_VERSION=v1.0.0-dev" >> "$GITHUB_ENV"
22-
elif [ ${{github.ref_name}} == 'testing-juce8' ]; then
23-
echo "GUI_BRANCH=testing-juce8" >> "$GITHUB_ENV"
24-
echo "GUI_LIB_VERSION=v1.0.0-alpha" >> "$GITHUB_ENV"
25-
else
26-
echo "Invalid branch : ${{github.ref_name}}"
27-
exit 1
28-
fi
29-
shell: bash
3021
- name: setup
3122
run: |
3223
cd ../..
33-
git clone https://github.com/open-ephys/plugin-GUI.git --branch $GUI_BRANCH
24+
git clone https://github.com/open-ephys/plugin-GUI.git --branch main
3425
cd plugin-GUI/Build
3526
cmake -G "Visual Studio 17 2022" -A x64 ..
3627
mkdir Release && cd Release
37-
curl -L https://openephys.jfrog.io/artifactory/GUI-binaries/Libraries/open-ephys-lib-$GUI_LIB_VERSION.zip --output open-ephys-lib.zip
28+
curl -L https://openephys.jfrog.io/artifactory/GUI-binaries/Libraries/open-ephys-lib-v1.0.0.zip --output open-ephys-lib.zip
3829
unzip open-ephys-lib.zip
3930
shell: bash
4031
- name: config-fftw
4132
run: |
4233
cd ../..
4334
mkdir OEPlugins && cd OEPlugins
44-
git clone https://github.com/open-ephys-plugins/OpenEphysFFTW.git --branch ${{github.ref_name}}
35+
git clone https://github.com/open-ephys-plugins/OpenEphysFFTW.git --branch main
4536
cd OpenEphysFFTW/Build
4637
cmake -G "Visual Studio 17 2022" -A x64 ..
4738
shell: bash
4839
- name: Add msbuild to PATH
49-
uses: microsoft/setup-msbuild@v1.0.2
40+
uses: microsoft/setup-msbuild@v2
5041
- name: build-fftw
5142
run: |
5243
msbuild ../../OEPlugins/OpenEphysFFTW/Build/INSTALL.vcxproj -p:Configuration=Release -p:Platform=x64
@@ -64,7 +55,7 @@ jobs:
6455
# - name: test
6556
# run: cd build && ctest
6657
- name: deploy
67-
if: github.ref == 'refs/heads/testing-juce8'
58+
if: github.ref == 'refs/heads/main'
6859
env:
6960
ARTIFACTORY_ACCESS_TOKEN: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
7061
build_dir: "Build/Release"

0 commit comments

Comments
 (0)