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