Skip to content

Commit 60ef19b

Browse files
committed
Add Mac and Windows Build + Deploy Github Actions (+2 squashed commit)
Squashed commit: [970be72] Add macOS Build + Deploy Github Action [3b95831] Update macos build
1 parent d8e8b04 commit 60ef19b

2 files changed

Lines changed: 236 additions & 12 deletions

File tree

Lines changed: 75 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
name: Test Build on macOS
1+
name: Build and Deploy GUI for macOS
2+
23
on:
4+
workflow_dispatch:
35
pull_request:
46
branches: [master, development]
57
push:
@@ -13,8 +15,9 @@ env:
1315
AWS_REGION : us-east-1
1416

1517
jobs:
16-
check:
17-
name: Build GUI on macOS
18+
build:
19+
name: Run Unit Tests and Build macOS GUI
20+
if: github.event_name != 'workflow_dispatch'
1821
runs-on: macos-latest
1922

2023
steps:
@@ -44,9 +47,65 @@ jobs:
4447
run: |
4548
echo "$GITHUB_WORKSPACE/release_script/mac_only/" >> $GITHUB_PATH
4649
chmod +x $GITHUB_WORKSPACE/release_script/mac_only/processing-java
50+
51+
- name: Check GITHUB PATH
52+
run: echo $GITHUB_PATH
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/Documents/Processing/libraries/
61+
cp -a $GITHUB_WORKSPACE/OpenBCI_GUI/libraries/. $HOME/Documents/Processing/libraries/
62+
63+
- name: Run Unit Tests
64+
run: |
65+
ls
66+
python $GITHUB_WORKSPACE/OpenBCI_GUI_UnitTests/run-unittests.py
67+
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
4791

48-
- name: Check PATH
49-
run: echo $PATH
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
50109
51110
- name: Check GITHUB PATH
52111
run: echo $GITHUB_PATH
@@ -87,19 +146,23 @@ jobs:
87146
python $GITHUB_WORKSPACE/release_script/make-release.py --no-prompts
88147
GUI_COMMIT_TIME=`cat temp/timestamp.txt`
89148
GUI_VERSION_STRING=`cat temp/versionstring.txt`
149+
150+
- name: Configure AWS credentials from Production account
151+
uses: aws-actions/configure-aws-credentials@v2
152+
with:
153+
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
154+
aws-region: ${{ env.AWS_REGION }}
90155

91156
- name: Store DMG on AWS
92-
env:
93-
AWS_DEFAULT_REGION: ${{ env.AWS_REGION }}
94-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_2023 }}
95-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_2023 }}
96157
run: |
158+
cd $GITHUB_WORKSPACE
159+
ls
97160
export CURRENT_BRANCH=`git branch --show-current`
98161
export GUI_COMMIT_TIME=`cat temp/timestamp.txt`
99162
export GUI_VERSION_STRING=`cat temp/versionstring.txt`
100-
cd $GITHUB_WORKSPACE
101-
ls
163+
echo $GUI_COMMIT_TIME
164+
echo $GUI_VERSION_STRING
165+
echo $CURRENT_BRANCH
102166
aws s3 rm s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_macosx.dmg"
103167
aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/${GUI_VERSION_STRING} --recursive --exclude "*" --include "openbcigui_*_macosx.dmg"
104168
aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_macosx.dmg"
105-
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
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: Run Unit Tests and Build Windows GUI
20+
if: github.event_name != 'workflow_dispatch'
21+
runs-on: windows-2019
22+
23+
steps:
24+
- name: Clone Repository
25+
uses: actions/checkout@v3
26+
27+
- name: Install Python 3.9
28+
uses: actions/setup-python@v4
29+
with:
30+
python-version: '3.9'
31+
architecture: 'x64'
32+
cache: 'pip' # caching pip dependencies
33+
34+
- name: Install Python Dependencies
35+
run: |
36+
python -m pip install requests
37+
python -m pip install beautifulsoup4
38+
39+
- name: Install Processing
40+
run: |
41+
mkdir %GITHUB_WORKSPACE%\temp
42+
cd %GITHUB_WORKSPACE%\temp
43+
curl -O -L --insecure https://github.com/processing/processing4/releases/download/processing-1292-4.2/processing-4.2-windows-x64.zip
44+
ls -l %GITHUB_WORKSPACE%\temp
45+
unzip processing-4.2-windows-x64.zip
46+
ls -l %GITHUB_WORKSPACE%\temp\processing-4.2
47+
mkdir %userprofile%\documents\processing\libraries
48+
xcopy %GITHUB_WORKSPACE%\OpenBCI_GUI\libraries\* %userprofile%\documents\processing\libraries /s /i /q
49+
ls -l %userprofile%\documents\processing\libraries
50+
shell: cmd
51+
52+
- name: Set Path
53+
run: |
54+
echo %GITHUB_WORKSPACE%\temp\processing-4.2 >> %GITHUB_PATH%
55+
echo C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64 >> %GITHUB_PATH%
56+
ls -l "C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64"
57+
shell: cmd
58+
59+
- name: Print Path
60+
run: echo %PATH%
61+
shell: cmd
62+
63+
- name: Run Unit Tests
64+
run: |
65+
python %GITHUB_WORKSPACE%\OpenBCI_GUI_UnitTests\run-unittests.py
66+
shell: cmd
67+
68+
- name: Build Script
69+
run: |
70+
python %GITHUB_WORKSPACE%\release_script\make-release.py --no-prompts
71+
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
77+
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+

0 commit comments

Comments
 (0)