@@ -12,89 +12,142 @@ permissions:
1212 contents : read
1313
1414env :
15- AWS_REGION : us-east-1
15+ AWS_REGION : us-east-1
1616
1717jobs :
1818 build :
1919 name : Build for Windows
2020 runs-on : windows-latest
2121
2222 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-
32- - name : Install Processing
33- run : |
34- mkdir %GITHUB_WORKSPACE%\processing
35- cd %GITHUB_WORKSPACE%\processing
36- curl -O -L --insecure https://github.com/processing/processing4/releases/download/processing-1292-4.2/processing-4.2-windows-x64.zip
37- ls -l %GITHUB_WORKSPACE%\processing
38- unzip processing-4.2-windows-x64.zip
39- ls -l %GITHUB_WORKSPACE%\processing\processing-4.2
40- mkdir %userprofile%\documents\processing\libraries
41- xcopy %GITHUB_WORKSPACE%\OpenBCI_GUI\libraries\* %userprofile%\documents\processing\libraries /s /i /q
42- ls -l %userprofile%\documents\processing\libraries
43- shell : cmd
44-
45- - name : Set Path
46- run : |
47- echo %GITHUB_WORKSPACE%\processing\processing-4.2>>%GITHUB_PATH%
48- echo C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64>>%GITHUB_PATH%
49- shell : cmd
50-
51- - name : Print Path
52- run : echo %PATH%
53- shell : cmd
54-
55- - name : Check processing-java Command
56- run : processing-java --help
57- shell : cmd
58-
59- - name : Run Unit Tests
60- run : python %GITHUB_WORKSPACE%\GuiUnitTests\run-unittests.py
61- shell : cmd
62-
63- - name : Build
64- run : python %GITHUB_WORKSPACE%\release\build.py
65- shell : cmd
66-
67- - name : Sign
68- run : |
69- dotnet tool install --global azuresigntool
70- mt -manifest %GITHUB_WORKSPACE%\release\windows\gui.manifest -outputresource:%GITHUB_WORKSPACE%\application.windows64\OpenBCI_GUI.exe;#1
71- mt -manifest %GITHUB_WORKSPACE%\release\windows\java.manifest -outputresource:%GITHUB_WORKSPACE%\application.windows64\java\bin\java.exe;#1
72- mt -manifest %GITHUB_WORKSPACE%\release\windows\javaw.manifest -outputresource:%GITHUB_WORKSPACE%\application.windows64\java\bin\javaw.exe;#1
73- azuresigntool sign --azure-key-vault-url "${{ secrets.AZURE_KEY_VAULT_URI }}" --azure-key-vault-client-id "${{ secrets.AZURE_CLIENT_ID }}" --azure-key-vault-tenant-id "${{ secrets.AZURE_TENANT_ID }}" --azure-key-vault-client-secret "${{ secrets.AZURE_CLIENT_SECRET }}" --azure-key-vault-certificate "${{ secrets.AZURE_CERT_NAME }}" --timestamp-rfc3161 http://timestamp.digicert.com --verbose %GITHUB_WORKSPACE%\application.windows64\OpenBCI_GUI.exe
74- shell : cmd
75-
76- - name : Package
77- run : python %GITHUB_WORKSPACE%\release\package.py
78- shell : cmd
79-
80- - name : Configure AWS credentials
81- uses : aws-actions/configure-aws-credentials@v2
82- with :
83- role-to-assume : ${{ secrets.AWS_ROLE_TO_ASSUME }}
84- aws-region : ${{ env.AWS_REGION }}
85-
86- - name : Get Branch Names
87- id : branch-name
88- uses : tj-actions/branch-names@v7
89-
90- - name : Store Build on AWS
91- run : |
92- cd ${{ github.workspace }}
93- ls
94- echo "${{ steps.branch-name.outputs.head_ref_branch }}"
95- set S3_BRANCH_FOLDER=s3://openbci-public-gui-v6/${{ steps.branch-name.outputs.head_ref_branch }}
96- echo %S3_BRANCH_FOLDER%
97- aws s3 rm s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_windows64.zip"
98- aws s3 cp ${{ github.workspace }}/. %S3_BRANCH_FOLDER% --recursive --exclude "*" --include "openbcigui_*_windows64.zip"
99- aws s3 cp ${{ github.workspace }}/. s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_windows64.zip"
100- shell : cmd
23+ - name : Clone Repository
24+ uses : actions/checkout@v4
25+
26+ - name : Install Python 3.9
27+ uses : actions/setup-python@v5
28+ with :
29+ python-version : ' 3.9'
30+ architecture : ' x64'
31+
32+ - name : Install Processing
33+ run : |
34+ mkdir %GITHUB_WORKSPACE%\processing
35+ cd %GITHUB_WORKSPACE%\processing
36+ curl -O -L --insecure https://github.com/processing/processing4/releases/download/processing-1292-4.2/processing-4.2-windows-x64.zip
37+ ls -l %GITHUB_WORKSPACE%\processing
38+ unzip processing-4.2-windows-x64.zip
39+ ls -l %GITHUB_WORKSPACE%\processing\processing-4.2
40+ mkdir %userprofile%\documents\processing\libraries
41+ xcopy %GITHUB_WORKSPACE%\OpenBCI_GUI\libraries\* %userprofile%\documents\processing\libraries /s /i /q
42+ ls -l %userprofile%\documents\processing\libraries
43+ shell : cmd
44+
45+ - name : Set Path
46+ run : |
47+ echo %GITHUB_WORKSPACE%\processing\processing-4.2>>%GITHUB_PATH%
48+ echo C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64>>%GITHUB_PATH%
49+ shell : cmd
50+
51+ - name : Print Path
52+ run : echo %PATH%
53+ shell : cmd
54+
55+ - name : Check processing-java Command
56+ run : processing-java --help
57+ shell : cmd
58+
59+ - name : Update Processing Application Icon File
60+ run : |
61+ echo ${{ env.gui-icon-parent-folder }}
62+ ls -l ${{ env.gui-icon-parent-folder }}
63+ echo ${{ env.processing-icon-path }}
64+ ls -l ${{ env.processing-icon-path }}
65+ xcopy ${{ env.gui-icon-path }} ${{ env.processing-icon-path }} /i /y
66+ env :
67+ gui-icon-parent-folder : ${{ github.workspace }}\release\windows\icons\application
68+ gui-icon-path : ${{ github.workspace }}\release\windows\icons\application\application.ico
69+ processing-icon-path : ${{ github.workspace }}\processing\processing-4.2\modes\java\application
70+
71+ - name : Update Processing Core Icon Files
72+ run : |
73+ ren ${{ env.processing-core-folder }}\core.jar core.zip
74+ mkdir ${{ env.processing-core-icon-path }}
75+ ls -l ${{ env.processing-core-folder }}
76+ unzip ${{ env.processing-core-folder }}\core.zip -d ${{ env.processing-core-unzip-path }}
77+ del ${{ env.processing-core-folder }}\core.zip
78+ xcopy ${{ env.gui-core-icon-path }} ${{ env.processing-core-icon-path }} /e /i /y
79+ cd ${{ env.processing-core-unzip-path }}
80+ ls -l
81+ 7z a -r core.zip *
82+ ren core.zip core.jar
83+ echo "Updated Processing Core Icon Files"
84+ ls -l
85+ move core.jar ${{ env.processing-core-updated-jar-path }}
86+ cd ${{ env.processing-core-updated-jar-path }}
87+ rmdir ${{ env.processing-core-icon-path }} /s /q
88+ ls -l
89+ env :
90+ processing-core-folder : ${{ github.workspace }}\processing\processing-4.2\core\library\
91+ processing-core-unzip-path : ${{ github.workspace }}\processing\processing-4.2\core\library\core
92+ gui-core-icon-path : ${{ github.workspace }}\release\windows\icons\core\*
93+ processing-core-icon-path : ${{ github.workspace }}\processing\processing-4.2\core\library\core\icon
94+ processing-core-updated-jar-path : ${{ github.workspace }}\processing\processing-4.2\core\library\
95+ shell : cmd
96+
97+ - name : Run Unit Tests
98+ run : python %GITHUB_WORKSPACE%\GuiUnitTests\run-unittests.py
99+ shell : cmd
100+
101+ - name : Build
102+ run : python %GITHUB_WORKSPACE%\release\build.py
103+ shell : cmd
104+
105+ - name : Sign Executables
106+ if : ${{ true }}
107+ run : |
108+ dotnet tool install --global azuresigntool
109+ mt -manifest %GITHUB_WORKSPACE%\release\windows\gui.manifest -outputresource:%GITHUB_WORKSPACE%\application.windows64\OpenBCI_GUI.exe;#1
110+ mt -manifest %GITHUB_WORKSPACE%\release\windows\java.manifest -outputresource:%GITHUB_WORKSPACE%\application.windows64\java\bin\java.exe;#1
111+ mt -manifest %GITHUB_WORKSPACE%\release\windows\javaw.manifest -outputresource:%GITHUB_WORKSPACE%\application.windows64\java\bin\javaw.exe;#1
112+ azuresigntool sign --azure-key-vault-url "${{ secrets.AZURE_KEY_VAULT_URI }}" --azure-key-vault-client-id "${{ secrets.AZURE_CLIENT_ID }}" --azure-key-vault-tenant-id "${{ secrets.AZURE_TENANT_ID }}" --azure-key-vault-client-secret "${{ secrets.AZURE_CLIENT_SECRET }}" --azure-key-vault-certificate "${{ secrets.AZURE_CERT_NAME }}" --timestamp-rfc3161 http://timestamp.digicert.com --verbose %GITHUB_WORKSPACE%\application.windows64\OpenBCI_GUI.exe
113+ shell : cmd
114+
115+ - name : Package
116+ id : package
117+ run : python %GITHUB_WORKSPACE%\release\package.py
118+ shell : cmd
119+
120+ - name : Sign MSI Package
121+ if : ${{ true }}
122+ run : |
123+ azuresigntool sign --azure-key-vault-url "${{ secrets.AZURE_KEY_VAULT_URI }}" --azure-key-vault-client-id "${{ secrets.AZURE_CLIENT_ID }}" --azure-key-vault-tenant-id "${{ secrets.AZURE_TENANT_ID }}" --azure-key-vault-client-secret "${{ secrets.AZURE_CLIENT_SECRET }}" --azure-key-vault-certificate "${{ secrets.AZURE_CERT_NAME }}" --timestamp-rfc3161 http://timestamp.digicert.com --verbose ${{ env.msi-path }}
124+ env :
125+ msi-path : ${{ steps.package.outputs.msi_path }}
126+ shell : cmd
127+
128+ - name : Configure AWS credentials
129+ uses : aws-actions/configure-aws-credentials@v4
130+ with :
131+ role-to-assume : ${{ secrets.AWS_ROLE_TO_ASSUME }}
132+ aws-region : ${{ env.AWS_REGION }}
133+
134+ - name : Get Branch Names
135+ id : branch-name
136+ uses : tj-actions/branch-names@v8
137+
138+ - name : Store Build on AWS
139+ run : |
140+ cd ${{ env.msi-path }}
141+ ls
142+ echo "${{ steps.branch-name.outputs.head_ref_branch }}"
143+ set S3_BRANCH_FOLDER=s3://openbci-public-gui-v7/${{ steps.branch-name.outputs.head_ref_branch }}
144+ echo Branch Folder: %S3_BRANCH_FOLDER%
145+ set S3_LATEST_FOLDER=s3://openbci-public-gui-v7/latest
146+ echo Latest Folder: %S3_LATEST_FOLDER%
147+ aws s3 rm %S3_LATEST_FOLDER% --recursive --exclude "*" --include "*.msi"
148+ aws s3 rm %S3_BRANCH_FOLDER% --recursive --exclude "*" --include "*.msi"
149+ aws s3 cp . %S3_BRANCH_FOLDER% --recursive --exclude "*" --include "*.msi"
150+ aws s3 cp . %S3_LATEST_FOLDER% --recursive --exclude "*" --include "*.msi"
151+ env :
152+ msi-path : ${{ github.workspace }}\release\wix\bin\Release\en-US\
153+ shell : cmd
0 commit comments