Skip to content

Commit d38587b

Browse files
committed
Add Linux Github Action for Build + Deploy
1 parent 60ef19b commit d38587b

13 files changed

Lines changed: 606 additions & 522 deletions
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Build GUI for Linux
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
logLevel:
7+
description: 'Log level'
8+
required: false
9+
default: 'warning'
10+
tags:
11+
description: 'Build and deploy for specific tags'
12+
pull_request:
13+
branches: [master, development]
14+
push:
15+
branches: [master, development]
16+
17+
permissions:
18+
id-token: write
19+
contents: read
20+
21+
env:
22+
AWS_REGION : us-east-1
23+
24+
jobs:
25+
build:
26+
name: Build for Linux
27+
runs-on: ubuntu-20.04
28+
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v3
32+
33+
- name: Setup Python
34+
uses: actions/setup-python@v4
35+
with:
36+
python-version: '3.9'
37+
cache: 'pip' # caching pip dependencies
38+
39+
- name: Install Python Dependencies
40+
run: pip install -r release_script/requirements.txt
41+
42+
- name: Download and Unzip Processing
43+
run: |
44+
mkdir -p $GITHUB_WORKSPACE/temp
45+
cd $GITHUB_WORKSPACE/temp
46+
curl -O -L --insecure https://github.com/processing/processing4/releases/download/processing-1292-4.2/processing-4.2-linux-x64.tgz
47+
tar -xzvf processing-4.2-linux-x64.tgz
48+
ls
49+
50+
- name: Add Processing to PATH
51+
run: |
52+
sudo su -c "ln -s $GITHUB_WORKSPACE/temp/processing-4.2/processing-java /usr/local/bin/processing-java"
53+
54+
- name: Test processing-java command
55+
run: |
56+
processing-java --help
57+
58+
- name: Copy libraries to Processing
59+
run: |
60+
mkdir -p $HOME/sketchbook/libraries/
61+
cp -a $GITHUB_WORKSPACE/OpenBCI_GUI/libraries/. $HOME/sketchbook/libraries/
62+
63+
- name: Run Unit Tests
64+
run: |
65+
echo "Unit tests cannot be run on Linux without attached display."
66+
echo "https://github.com/processing/processing/wiki/Running-without-a-Display"
67+
68+
- name: Build GUI
69+
run: |
70+
touch temp/timestamp.txt
71+
touch temp/versionstring.txt
72+
python $GITHUB_WORKSPACE/release_script/make-release.py --no-prompts
73+
GUI_COMMIT_TIME=`cat temp/timestamp.txt`
74+
GUI_VERSION_STRING=`cat temp/versionstring.txt`
75+
76+
- name: Configure AWS credentials from Production account
77+
if: github.event_name == 'workflow_dispatch'
78+
uses: aws-actions/configure-aws-credentials@v2
79+
with:
80+
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
81+
aws-region: ${{ env.AWS_REGION }}
82+
83+
- name: Store DMG on AWS
84+
if: github.event_name == 'workflow_dispatch'
85+
run: |
86+
cd $GITHUB_WORKSPACE
87+
ls
88+
export CURRENT_BRANCH=`git branch --show-current`
89+
export GUI_COMMIT_TIME=`cat temp/timestamp.txt`
90+
export GUI_VERSION_STRING=`cat temp/versionstring.txt`
91+
echo $GUI_COMMIT_TIME
92+
echo $GUI_VERSION_STRING
93+
echo $CURRENT_BRANCH
94+
aws s3 rm s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_linux64.zip"
95+
aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/${GUI_VERSION_STRING} --recursive --exclude "*" --include "openbcigui_*_linux64.zip"
96+
aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_linux64.zip"
Lines changed: 8 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and Deploy GUI for macOS
1+
name: Build GUI for macOS
22

33
on:
44
workflow_dispatch:
@@ -16,7 +16,7 @@ env:
1616

1717
jobs:
1818
build:
19-
name: Run Unit Tests and Build macOS GUI
19+
name: Test Build for macOS
2020
if: github.event_name != 'workflow_dispatch'
2121
runs-on: macos-latest
2222

@@ -63,68 +63,10 @@ jobs:
6363
- name: Run Unit Tests
6464
run: |
6565
ls
66-
python $GITHUB_WORKSPACE/OpenBCI_GUI_UnitTests/run-unittests.py
66+
python $GITHUB_WORKSPACE/GuiUnitTests/run-unittests.py
6767
68-
- name: Build GUI
69-
run: |
70-
mkdir $GITHUB_WORKSPACE/temp
71-
touch temp/timestamp.txt
72-
touch temp/versionstring.txt
73-
python $GITHUB_WORKSPACE/release_script/make-release.py --no-prompts
74-
GUI_COMMIT_TIME=`cat temp/timestamp.txt`
75-
GUI_VERSION_STRING=`cat temp/versionstring.txt`
76-
77-
build_and_deploy:
78-
name: Build GUI on macOS
79-
if: github.event_name == 'workflow_dispatch'
80-
runs-on: macos-latest
81-
82-
steps:
83-
- name: Checkout
84-
uses: actions/checkout@v3
85-
86-
- name: Setup Python
87-
uses: actions/setup-python@v4
88-
with:
89-
python-version: '3.9'
90-
cache: 'pip' # caching pip dependencies
91-
92-
- name: Install Python Dependencies
93-
run: pip install -r release_script/requirements.txt
94-
95-
- name: Download and Unzip Processing
96-
run: |
97-
curl -O -L --insecure https://github.com/processing/processing4/releases/download/processing-1292-4.2/processing-4.2-macos-x64.zip
98-
unzip processing-4.2-macos-x64.zip
99-
ls
100-
101-
- name: Move Processing.app to Applications
102-
run: |
103-
mv Processing.app /Applications/Processing.app
104-
105-
- name: Add Processing to PATH
106-
run: |
107-
echo "$GITHUB_WORKSPACE/release_script/mac_only/" >> $GITHUB_PATH
108-
chmod +x $GITHUB_WORKSPACE/release_script/mac_only/processing-java
109-
110-
- name: Check GITHUB PATH
111-
run: echo $GITHUB_PATH
112-
113-
- name: Test processing-java command
114-
run: |
115-
processing-java --help
116-
117-
- name: Copy libraries to Processing
118-
run: |
119-
mkdir -p $HOME/Documents/Processing/libraries/
120-
cp -a $GITHUB_WORKSPACE/OpenBCI_GUI/libraries/. $HOME/Documents/Processing/libraries/
121-
122-
- name: Run Unit Tests
123-
run: |
124-
ls
125-
python $GITHUB_WORKSPACE/OpenBCI_GUI_UnitTests/run-unittests.py
126-
12768
- name: Decrypt Certificate
69+
if: github.event_name == 'workflow_dispatch'
12870
run: |
12971
openssl version
13072
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"
@@ -133,6 +75,7 @@ jobs:
13375
OPENSSL_CERT_K: ${{ secrets.OPENSSL_CERT_K }}
13476

13577
- name: Add OSX Signing Certificate
78+
if: github.event_name == 'workflow_dispatch'
13679
uses: apple-actions/import-codesign-certs@v2
13780
with:
13881
p12-filepath: ${{ github.workspace }}/release_script/mac_only/Certificates.p12
@@ -148,12 +91,14 @@ jobs:
14891
GUI_VERSION_STRING=`cat temp/versionstring.txt`
14992
15093
- name: Configure AWS credentials from Production account
94+
if: github.event_name == 'workflow_dispatch'
15195
uses: aws-actions/configure-aws-credentials@v2
15296
with:
15397
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
15498
aws-region: ${{ env.AWS_REGION }}
15599

156100
- name: Store DMG on AWS
101+
if: github.event_name == 'workflow_dispatch'
157102
run: |
158103
cd $GITHUB_WORKSPACE
159104
ls
@@ -165,4 +110,4 @@ jobs:
165110
echo $CURRENT_BRANCH
166111
aws s3 rm s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_macosx.dmg"
167112
aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/${GUI_VERSION_STRING} --recursive --exclude "*" --include "openbcigui_*_macosx.dmg"
168-
aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_macosx.dmg"
113+
aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_macosx.dmg"

.github/workflows/windows_build_deploy.yml

Lines changed: 65 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ env:
1616

1717
jobs:
1818
build:
19-
name: Run Unit Tests and Build Windows GUI
19+
name: Test Build for Windows
2020
if: github.event_name != 'workflow_dispatch'
2121
runs-on: windows-2019
2222

@@ -57,105 +57,76 @@ jobs:
5757
shell: cmd
5858

5959
- name: Print Path
60-
run: echo %PATH%
60+
run: echo %GITHUB_PATH%
6161
shell: cmd
62-
62+
63+
- name: Explicitly run processing-java
64+
run: |
65+
%GITHUB_WORKSPACE%\temp\processing-4.2\processing-java.exe --help
66+
shell: cmd
67+
68+
- name: Check processing-java command
69+
run: |
70+
set PATH=%PATH%;%GITHUB_WORKSPACE%\temp\processing-4.2
71+
processing-java --help
72+
shell: cmd
73+
6374
- name: Run Unit Tests
6475
run: |
65-
python %GITHUB_WORKSPACE%\OpenBCI_GUI_UnitTests\run-unittests.py
76+
set PATH=%PATH%;%GITHUB_WORKSPACE%\temp\processing-4.2
77+
ls -l
78+
python %GITHUB_WORKSPACE%\GuiUnitTests\run-unittests.py
6679
shell: cmd
6780

68-
- name: Build Script
81+
- name: Build without Signing
82+
if: github.event_name != 'workflow_dispatch'
6983
run: |
84+
echo %cd%
85+
ls
86+
set PATH=%PATH%;%GITHUB_WORKSPACE%\temp\processing-4.2
87+
set PATH=%PATH%;C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64
7088
python %GITHUB_WORKSPACE%\release_script\make-release.py --no-prompts
7189
shell: cmd
72-
73-
build_and_deploy:
74-
name: Build, Sign, and Deploy Windows GUI
75-
if: github.event_name == 'workflow_dispatch'
76-
runs-on: windows-2019
7790

78-
steps:
79-
- name: Clone Repository
80-
uses: actions/checkout@v3
81-
82-
- name: Install Python 3.9
83-
uses: actions/setup-python@v4
84-
with:
85-
python-version: '3.9'
86-
architecture: 'x64'
87-
cache: 'pip' # caching pip dependencies
88-
89-
- name: Install Python Dependencies
90-
run: |
91-
python -m pip install requests
92-
python -m pip install beautifulsoup4
93-
94-
- name: Install Processing
95-
run: |
96-
mkdir %GITHUB_WORKSPACE%\temp
97-
cd %GITHUB_WORKSPACE%\temp
98-
curl -O -L --insecure https://github.com/processing/processing4/releases/download/processing-1292-4.2/processing-4.2-windows-x64.zip
99-
ls -l %GITHUB_WORKSPACE%\temp
100-
unzip processing-4.2-windows-x64.zip
101-
ls -l %GITHUB_WORKSPACE%\temp\processing-4.2
102-
mkdir %userprofile%\documents\processing\libraries
103-
xcopy %GITHUB_WORKSPACE%\OpenBCI_GUI\libraries\* %userprofile%\documents\processing\libraries /s /i /q
104-
ls -l %userprofile%\documents\processing\libraries
105-
shell: cmd
106-
107-
- name: Set Path
108-
run: |
109-
echo %GITHUB_WORKSPACE%\temp\processing-4.2 >> %GITHUB_PATH%
110-
echo C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64 >> %GITHUB_PATH%
111-
ls -l "C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64"
112-
shell: cmd
113-
114-
- name: Print Path
115-
run: echo %PATH%
116-
shell: cmd
117-
118-
- name: Decrypt pfx files
119-
run: |
120-
iex ((New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/appveyor/secure-file/master/install.ps1'))
121-
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
122-
ls -l $env:GITHUB_WORKSPACE\release_script\windows_only
123-
env:
124-
PFX_PASS: ${{ secrets.PFX_PASS }}
125-
PFX_SECRET: ${{ secrets.PFX_SECRET }}
126-
PFX_SALT: ${{ secrets.PFX_SALT }}
127-
128-
- name: Run Unit Tests
129-
run: |
130-
python %GITHUB_WORKSPACE%\OpenBCI_GUI_UnitTests\run-unittests.py
131-
shell: cmd
132-
133-
- name: Build Script
134-
run: |
135-
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
136-
env:
137-
PFX_PASS: ${{ secrets.PFX_PASS }}
138-
PFX_SECRET: ${{ secrets.PFX_SECRET }}
139-
PFX_SALT: ${{ secrets.PFX_SALT }}
140-
shell: cmd
141-
142-
- name: Configure AWS credentials from Production account
143-
uses: aws-actions/configure-aws-credentials@v2
144-
with:
145-
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
146-
aws-region: ${{ env.AWS_REGION }}
147-
148-
- name: Store Build on AWS
149-
run: |
150-
cd $GITHUB_WORKSPACE
151-
ls
152-
export CURRENT_BRANCH=`git branch --show-current`
153-
export GUI_COMMIT_TIME=`cat temp/timestamp.txt`
154-
export GUI_VERSION_STRING=`cat temp/versionstring.txt`
155-
echo $GUI_COMMIT_TIME
156-
echo $GUI_VERSION_STRING
157-
echo $CURRENT_BRANCH
158-
aws s3 rm s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_macosx.dmg"
159-
aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/${GUI_VERSION_STRING} --recursive --exclude "*" --include "openbcigui_*_macosx.dmg"
160-
aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_macosx.dmg"
161-
91+
- name: Decrypt pfx files
92+
if: github.event_name == 'workflow_dispatch'
93+
run: |
94+
iex ((New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/appveyor/secure-file/master/install.ps1'))
95+
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
96+
ls -l $env:GITHUB_WORKSPACE\release_script\windows_only
97+
env:
98+
PFX_PASS: ${{ secrets.PFX_PASS }}
99+
PFX_SECRET: ${{ secrets.PFX_SECRET }}
100+
PFX_SALT: ${{ secrets.PFX_SALT }}
101+
102+
- name: Build and Sign
103+
if: github.event_name == 'workflow_dispatch'
104+
run: |
105+
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
106+
env:
107+
PFX_PASS: ${{ secrets.PFX_PASS }}
108+
PFX_SECRET: ${{ secrets.PFX_SECRET }}
109+
PFX_SALT: ${{ secrets.PFX_SALT }}
110+
shell: cmd
111+
112+
- name: Configure AWS credentials from Production account
113+
if: github.event_name == 'workflow_dispatch'
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: Store Build on AWS
120+
if: github.event_name == 'workflow_dispatch'
121+
run: |
122+
cd $GITHUB_WORKSPACE
123+
ls
124+
export CURRENT_BRANCH=`git branch --show-current`
125+
export GUI_COMMIT_TIME=`cat temp/timestamp.txt`
126+
export GUI_VERSION_STRING=`cat temp/versionstring.txt`
127+
echo $GUI_COMMIT_TIME
128+
echo $GUI_VERSION_STRING
129+
echo $CURRENT_BRANCH
130+
aws s3 rm s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_macosx.dmg"
131+
aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/${GUI_VERSION_STRING} --recursive --exclude "*" --include "openbcigui_*_macosx.dmg"
132+
aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_macosx.dmg"

0 commit comments

Comments
 (0)