Skip to content

Commit 1ea6ff2

Browse files
authored
Merge pull request #1166 from OpenBCI/processing4-july-2023
Update to Processing 4.2
2 parents c803044 + e4f18b5 commit 1ea6ff2

24 files changed

Lines changed: 1106 additions & 781 deletions
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Build GUI for Linux
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches: [master, development]
7+
push:
8+
branches: [master, development]
9+
10+
permissions:
11+
id-token: write
12+
contents: read
13+
14+
env:
15+
AWS_REGION : us-east-1
16+
17+
jobs:
18+
build:
19+
name: Build for Linux
20+
runs-on: ubuntu-20.04
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v3
25+
26+
- name: Setup Python
27+
uses: actions/setup-python@v4
28+
with:
29+
python-version: '3.9'
30+
cache: 'pip' # caching pip dependencies
31+
32+
- name: Install Python Dependencies
33+
run: pip install -r release_script/requirements.txt
34+
35+
- name: Download and Unzip Processing
36+
run: |
37+
mkdir -p $GITHUB_WORKSPACE/temp
38+
cd $GITHUB_WORKSPACE/temp
39+
curl -O -L --insecure https://github.com/processing/processing4/releases/download/processing-1292-4.2/processing-4.2-linux-x64.tgz
40+
tar -xzvf processing-4.2-linux-x64.tgz
41+
ls
42+
43+
- name: Add Processing to PATH
44+
run: |
45+
sudo su -c "ln -s $GITHUB_WORKSPACE/temp/processing-4.2/processing-java /usr/local/bin/processing-java"
46+
47+
- name: Test processing-java command
48+
run: |
49+
processing-java --help
50+
51+
- name: Copy libraries to Processing
52+
run: |
53+
mkdir -p $HOME/sketchbook/libraries/
54+
cp -a $GITHUB_WORKSPACE/OpenBCI_GUI/libraries/. $HOME/sketchbook/libraries/
55+
56+
- name: Run Unit Tests
57+
run: |
58+
echo "Unit tests cannot be run on Linux without attached display."
59+
echo "https://github.com/processing/processing/wiki/Running-without-a-Display"
60+
61+
- name: Build GUI
62+
run: |
63+
touch temp/timestamp.txt
64+
touch temp/versionstring.txt
65+
python $GITHUB_WORKSPACE/release_script/make-release.py --no-prompts
66+
GUI_COMMIT_TIME=`cat temp/timestamp.txt`
67+
GUI_VERSION_STRING=`cat temp/versionstring.txt`
68+
69+
- name: Configure AWS credentials from Production account
70+
uses: aws-actions/configure-aws-credentials@v2
71+
with:
72+
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
73+
aws-region: ${{ env.AWS_REGION }}
74+
75+
- name: Get branch names
76+
id: branch-name
77+
uses: tj-actions/branch-names@v7
78+
79+
- name: Store DMG on AWS
80+
run: |
81+
cd $GITHUB_WORKSPACE
82+
ls
83+
CURRENT_BRANCH=${{ steps.branch-name.outputs.head_ref_branch }}
84+
echo $CURRENT_BRANCH
85+
aws s3 rm s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_linux64.zip"
86+
aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/${CURRENT_BRANCH} --recursive --exclude "*" --include "openbcigui_*_linux64.zip"
87+
aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_linux64.zip"
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: Build GUI for macOS
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches: [master, development]
7+
push:
8+
branches: [master, development]
9+
10+
permissions:
11+
id-token: write
12+
contents: read
13+
14+
env:
15+
AWS_REGION : us-east-1
16+
17+
jobs:
18+
build:
19+
name: Build for macOS
20+
runs-on: macos-latest
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v3
25+
26+
- name: Setup Python
27+
uses: actions/setup-python@v4
28+
with:
29+
python-version: '3.9'
30+
cache: 'pip' # caching pip dependencies
31+
32+
- name: Install Python Dependencies
33+
run: pip install -r release_script/requirements.txt
34+
35+
- name: Download and Unzip Processing
36+
run: |
37+
curl -O -L --insecure https://github.com/processing/processing4/releases/download/processing-1292-4.2/processing-4.2-macos-x64.zip
38+
unzip processing-4.2-macos-x64.zip
39+
ls
40+
41+
- name: Move Processing.app to Applications
42+
run: |
43+
mv Processing.app /Applications/Processing.app
44+
45+
- name: Add Processing to PATH
46+
run: |
47+
echo "$GITHUB_WORKSPACE/release_script/mac_only/" >> $GITHUB_PATH
48+
chmod +x $GITHUB_WORKSPACE/release_script/mac_only/processing-java
49+
50+
- name: Check GITHUB PATH
51+
run: echo $GITHUB_PATH
52+
53+
- name: Test processing-java command
54+
run: |
55+
processing-java --help
56+
57+
- name: Copy libraries to Processing
58+
run: |
59+
mkdir -p $HOME/Documents/Processing/libraries/
60+
cp -a $GITHUB_WORKSPACE/OpenBCI_GUI/libraries/. $HOME/Documents/Processing/libraries/
61+
62+
- name: Run Unit Tests
63+
run: |
64+
ls
65+
python $GITHUB_WORKSPACE/GuiUnitTests/run-unittests.py
66+
67+
- name: Save Encrypted Certificate to File
68+
run: |
69+
echo $MAC_CERTIFICATE_ENCRYPTED | base64 --decode > $GITHUB_WORKSPACE/release_script/mac_only/Certificates_2023.p12.enc
70+
env:
71+
MAC_CERTIFICATE_ENCRYPTED: ${{ secrets.MAC_CERTIFICATE_ENCRYPTED }}
72+
73+
- name: Decrypt Certificate
74+
run: |
75+
openssl version
76+
openssl enc -aes-256-cbc -a -d -pbkdf2 -in $GITHUB_WORKSPACE/release_script/mac_only/Certificates_2023.p12.enc -out $GITHUB_WORKSPACE/release_script/mac_only/Certificates.p12 -k "$OPENSSL_CERT_K"
77+
env:
78+
OPENSSL_CERT_K: ${{ secrets.OPENSSL_CERT_K }}
79+
80+
- name: Add OSX Signing Certificate to Keychain
81+
uses: apple-actions/import-codesign-certs@v2
82+
with:
83+
p12-filepath: ${{ github.workspace }}/release_script/mac_only/Certificates.p12
84+
p12-password: ${{ secrets.CERTIFICATE_P12_PASSWORD }}
85+
86+
- name: Build GUI
87+
run: |
88+
mkdir $GITHUB_WORKSPACE/temp
89+
touch temp/timestamp.txt
90+
touch temp/versionstring.txt
91+
python $GITHUB_WORKSPACE/release_script/make-release.py --no-prompts
92+
GUI_COMMIT_TIME=`cat temp/timestamp.txt`
93+
GUI_VERSION_STRING=`cat temp/versionstring.txt`
94+
95+
- name: Configure AWS credentials from Production account
96+
uses: aws-actions/configure-aws-credentials@v2
97+
with:
98+
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
99+
aws-region: ${{ env.AWS_REGION }}
100+
101+
- name: Get branch names
102+
id: branch-name
103+
uses: tj-actions/branch-names@v7
104+
105+
- name: Store DMG on AWS S3
106+
run: |
107+
cd $GITHUB_WORKSPACE
108+
ls
109+
CURRENT_BRANCH=${{ steps.branch-name.outputs.head_ref_branch }}
110+
echo $CURRENT_BRANCH
111+
aws s3 rm s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_macosx.dmg"
112+
aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/${CURRENT_BRANCH} --recursive --exclude "*" --include "openbcigui_*_macosx.dmg"
113+
aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_macosx.dmg"
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
name: Build GUI for Windows
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches: [master, development]
7+
push:
8+
branches: [master, development]
9+
10+
permissions:
11+
id-token: write
12+
contents: read
13+
14+
env:
15+
AWS_REGION : us-east-1
16+
17+
jobs:
18+
build:
19+
name: Build for Windows
20+
runs-on: windows-2019
21+
22+
steps:
23+
- name: Clone Repository
24+
uses: actions/checkout@v3
25+
26+
- name: Install Python 3.9
27+
uses: actions/setup-python@v4
28+
with:
29+
python-version: '3.9'
30+
architecture: 'x64'
31+
cache: 'pip' # caching pip dependencies
32+
33+
- name: Install Python Dependencies
34+
run: |
35+
python -m pip install requests
36+
python -m pip install beautifulsoup4
37+
38+
- name: Install Processing
39+
run: |
40+
mkdir %GITHUB_WORKSPACE%\temp
41+
cd %GITHUB_WORKSPACE%\temp
42+
curl -O -L --insecure https://github.com/processing/processing4/releases/download/processing-1292-4.2/processing-4.2-windows-x64.zip
43+
ls -l %GITHUB_WORKSPACE%\temp
44+
unzip processing-4.2-windows-x64.zip
45+
ls -l %GITHUB_WORKSPACE%\temp\processing-4.2
46+
mkdir %userprofile%\documents\processing\libraries
47+
xcopy %GITHUB_WORKSPACE%\OpenBCI_GUI\libraries\* %userprofile%\documents\processing\libraries /s /i /q
48+
ls -l %userprofile%\documents\processing\libraries
49+
shell: cmd
50+
51+
- name: Set Path
52+
run: |
53+
echo %GITHUB_WORKSPACE%\temp\processing-4.2 >> %GITHUB_PATH%
54+
echo C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64 >> %GITHUB_PATH%
55+
ls -l "C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64"
56+
shell: cmd
57+
58+
- name: Print Path
59+
run: echo %GITHUB_PATH%
60+
shell: cmd
61+
62+
- name: Explicitly run processing-java
63+
run: |
64+
%GITHUB_WORKSPACE%\temp\processing-4.2\processing-java.exe --help
65+
shell: cmd
66+
67+
- name: Check processing-java command
68+
run: |
69+
set PATH=%PATH%;%GITHUB_WORKSPACE%\temp\processing-4.2
70+
processing-java --help
71+
shell: cmd
72+
73+
- name: Run Unit Tests
74+
run: |
75+
set PATH=%PATH%;%GITHUB_WORKSPACE%\temp\processing-4.2
76+
ls -l
77+
python %GITHUB_WORKSPACE%\GuiUnitTests\run-unittests.py
78+
shell: cmd
79+
80+
- name: Build without Signing
81+
if: ${{ true }}
82+
run: |
83+
echo %cd%
84+
ls
85+
set PATH=%PATH%;%GITHUB_WORKSPACE%\temp\processing-4.2
86+
set PATH=%PATH%;C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64
87+
type nul > temp/versionstring.txt
88+
type nul > temp/timestamp.txt
89+
python %GITHUB_WORKSPACE%\release_script\make-release.py --no-prompts
90+
shell: cmd
91+
92+
- name: Decrypt pfx files
93+
if: ${{ false }}
94+
run: |
95+
iex ((New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/appveyor/secure-file/master/install.ps1'))
96+
appveyor-tools\secure-file -decrypt $env:GITHUB_WORKSPACE\release_script\windows_only\0a2d0e9821bd184a1d969a1db3630c92-SHA2.pfx.enc -secret $env:PFX_SECRET -salt $env:PFX_SALT -out $env:GITHUB_WORKSPACE\release_script\windows_only\0a2d0e9821bd184a1d969a1db3630c92-SHA2.pfx
97+
ls -l $env:GITHUB_WORKSPACE\release_script\windows_only
98+
env:
99+
PFX_PASS: ${{ secrets.PFX_PASS }}
100+
PFX_SECRET: ${{ secrets.PFX_SECRET }}
101+
PFX_SALT: ${{ secrets.PFX_SALT }}
102+
103+
- name: Build and Sign
104+
if: ${{ false }}
105+
run: |
106+
python %GITHUB_WORKSPACE%\release_script\make-release.py --no-prompts --pfx-password %PFX_PASS% --pfx-path %GITHUB_WORKSPACE%\release_script\windows_only\0a2d0e9821bd184a1d969a1db3630c92-SHA2.pfx
107+
env:
108+
PFX_PASS: ${{ secrets.PFX_PASS }}
109+
PFX_SECRET: ${{ secrets.PFX_SECRET }}
110+
PFX_SALT: ${{ secrets.PFX_SALT }}
111+
shell: cmd
112+
113+
- name: Configure AWS credentials from Production account
114+
uses: aws-actions/configure-aws-credentials@v2
115+
with:
116+
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
117+
aws-region: ${{ env.AWS_REGION }}
118+
119+
- name: Get branch names
120+
id: branch-name
121+
uses: tj-actions/branch-names@v7
122+
123+
- name: Store Build on AWS
124+
run: |
125+
cd ${{ github.workspace }}
126+
ls
127+
echo "${{ steps.branch-name.outputs.head_ref_branch }}"
128+
set S3_BRANCH_FOLDER=s3://openbci-public-gui-v6/${{ steps.branch-name.outputs.head_ref_branch }}
129+
echo %S3_BRANCH_FOLDER%
130+
aws s3 rm s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_windows64.zip"
131+
aws s3 cp ${{ github.workspace }}/. %S3_BRANCH_FOLDER% --recursive --exclude "*" --include "openbcigui_*_windows64.zip"
132+
aws s3 cp ${{ github.workspace }}/. s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_windows64.zip"
133+
shell: cmd
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build GUI for Windows - Processing 3
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- development
8+
9+
jobs:
10+
BuildWin:
11+
runs-on: windows-2019
12+
13+
steps:
14+
- name: Clone Repository
15+
uses: actions/checkout@v3
16+
- name: Install Python 3.9
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: '3.9'
20+
architecture: 'x64'
21+
cache: 'pip'
22+
- name: Install Python Dependencies
23+
run: |
24+
python -m pip install requests
25+
python -m pip install beautifulsoup4
26+
- name: Set Path
27+
run: |
28+
echo %GITHUB_WORKSPACE%\temp\processing-3.5.3>>%GITHUB_PATH%
29+
echo C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64>>%GITHUB_PATH%
30+
ls -l "C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64"
31+
shell: cmd
32+
- name: Print Path
33+
run: echo %GITHUB_PATH%
34+
shell: cmd
35+
36+
- name: Install Processing
37+
run: |
38+
mkdir %GITHUB_WORKSPACE%\temp
39+
cd %GITHUB_WORKSPACE%\temp
40+
curl -O -L --insecure https://download.processing.org/processing-3.5.3-windows64.zip
41+
ls -l %GITHUB_WORKSPACE%\temp
42+
unzip processing-3.5.3-windows64.zip
43+
ls -l %GITHUB_WORKSPACE%\temp\processing-3.5.3
44+
mkdir %userprofile%\documents\processing\libraries
45+
xcopy %GITHUB_WORKSPACE%\OpenBCI_GUI\libraries\* %userprofile%\documents\processing\libraries /s /i /q
46+
ls -l %userprofile%\documents\processing\libraries
47+
shell: cmd
48+
- name: Check processing-java
49+
run: processing-java --help
50+
shell: cmd
51+
- name: Build Script
52+
run: |
53+
python %GITHUB_WORKSPACE%\GuiUnitTests\run-unittests.py
54+
python %GITHUB_WORKSPACE%\release_script\make-release.py --no-prompts --pfx-password %PFX_PASS% --pfx-path %GITHUB_WORKSPACE%\release_script\windows_only\0a2d0e9821bd184a1d969a1db3630c92-SHA2.pfx
55+
shell: cmd

0 commit comments

Comments
 (0)