-
Notifications
You must be signed in to change notification settings - Fork 258
133 lines (114 loc) · 4.65 KB
/
p4_windows_build_deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Build GUI for Windows
on:
workflow_dispatch:
pull_request:
branches: [master, development]
push:
branches: [master, development]
permissions:
id-token: write
contents: read
env:
AWS_REGION : us-east-1
jobs:
build:
name: Build for Windows
runs-on: windows-2019
steps:
- name: Clone Repository
uses: actions/checkout@v3
- name: Install Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
architecture: 'x64'
cache: 'pip' # caching pip dependencies
- name: Install Python Dependencies
run: |
python -m pip install requests
python -m pip install beautifulsoup4
- name: Install Processing
run: |
mkdir %GITHUB_WORKSPACE%\temp
cd %GITHUB_WORKSPACE%\temp
curl -O -L --insecure https://github.com/processing/processing4/releases/download/processing-1292-4.2/processing-4.2-windows-x64.zip
ls -l %GITHUB_WORKSPACE%\temp
unzip processing-4.2-windows-x64.zip
ls -l %GITHUB_WORKSPACE%\temp\processing-4.2
mkdir %userprofile%\documents\processing\libraries
xcopy %GITHUB_WORKSPACE%\OpenBCI_GUI\libraries\* %userprofile%\documents\processing\libraries /s /i /q
ls -l %userprofile%\documents\processing\libraries
shell: cmd
- name: Set Path
run: |
echo %GITHUB_WORKSPACE%\temp\processing-4.2 >> %GITHUB_PATH%
echo C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64 >> %GITHUB_PATH%
ls -l "C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64"
shell: cmd
- name: Print Path
run: echo %GITHUB_PATH%
shell: cmd
- name: Explicitly run processing-java
run: |
%GITHUB_WORKSPACE%\temp\processing-4.2\processing-java.exe --help
shell: cmd
- name: Check processing-java command
run: |
set PATH=%PATH%;%GITHUB_WORKSPACE%\temp\processing-4.2
processing-java --help
shell: cmd
- name: Run Unit Tests
run: |
set PATH=%PATH%;%GITHUB_WORKSPACE%\temp\processing-4.2
ls -l
python %GITHUB_WORKSPACE%\GuiUnitTests\run-unittests.py
shell: cmd
- name: Build without Signing
if: ${{ true }}
run: |
echo %cd%
ls
set PATH=%PATH%;%GITHUB_WORKSPACE%\temp\processing-4.2
set PATH=%PATH%;C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64
type nul > temp/versionstring.txt
type nul > temp/timestamp.txt
python %GITHUB_WORKSPACE%\release_script\make-release.py --no-prompts
shell: cmd
- name: Decrypt pfx files
if: ${{ false }}
run: |
iex ((New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/appveyor/secure-file/master/install.ps1'))
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
ls -l $env:GITHUB_WORKSPACE\release_script\windows_only
env:
PFX_PASS: ${{ secrets.PFX_PASS }}
PFX_SECRET: ${{ secrets.PFX_SECRET }}
PFX_SALT: ${{ secrets.PFX_SALT }}
- name: Build and Sign
if: ${{ false }}
run: |
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
env:
PFX_PASS: ${{ secrets.PFX_PASS }}
PFX_SECRET: ${{ secrets.PFX_SECRET }}
PFX_SALT: ${{ secrets.PFX_SALT }}
shell: cmd
- name: Configure AWS credentials from Production account
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: ${{ env.AWS_REGION }}
- name: Get branch names
id: branch-name
uses: tj-actions/branch-names@v7
- name: Store Build on AWS
run: |
cd ${{ github.workspace }}
ls
echo "${{ steps.branch-name.outputs.head_ref_branch }}"
set S3_BRANCH_FOLDER=s3://openbci-public-gui-v6/${{ steps.branch-name.outputs.head_ref_branch }}
echo %S3_BRANCH_FOLDER%
aws s3 rm s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_windows64.zip"
aws s3 cp ${{ github.workspace }}/. %S3_BRANCH_FOLDER% --recursive --exclude "*" --include "openbcigui_*_windows64.zip"
aws s3 cp ${{ github.workspace }}/. s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_windows64.zip"
shell: cmd