-
Notifications
You must be signed in to change notification settings - Fork 258
152 lines (123 loc) · 4.78 KB
/
linux_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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Build GUI for Linux
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: Test Build for Linux
if: github.event_name != 'workflow_dispatch'
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip' # caching pip dependencies
- name: Install Python Dependencies
run: pip install -r release_script/requirements.txt
- name: Download and Unzip Processing
run: |
curl -O -L --insecure curl -O -L --insecure https://github.com/processing/processing4/releases/download/processing-1292-4.2/processing-4.2-linux-x64.tgz
tar -xzvf processing-4.2-linux-x64.tgz
ls
- name: Move Processing.app to Applications
run: |
mv Processing.app /Applications/Processing.app
- name: Add Processing to PATH
run: |
export PATH=$TRAVIS_BUILD_DIR/temp/processing-4.2:$PATH
- name: Check GITHUB PATH
run: echo $GITHUB_PATH
- name: Test processing-java command
run: |
processing-java --help
- name: Copy libraries to Processing
run: |
mkdir -p $HOME/sketchbook/libraries/
cp -a $GITHUB_WORKSPACE/OpenBCI_GUI/libraries/. $HOME/sketchbook/libraries/
- name: Run Unit Tests
run: |
ls
python $GITHUB_WORKSPACE/GuiUnitTests/run-unittests.py
- name: Build GUI
run: |
mkdir $GITHUB_WORKSPACE/temp
touch temp/timestamp.txt
touch temp/versionstring.txt
python $GITHUB_WORKSPACE/release_script/make-release.py --no-prompts
GUI_COMMIT_TIME=`cat temp/timestamp.txt`
GUI_VERSION_STRING=`cat temp/versionstring.txt`
build_and_deploy:
name: Build, Sign, and Deploy for Linux
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip' # caching pip dependencies
- name: Install Python Dependencies
run: pip install -r release_script/requirements.txt
- name: Download and Unzip Processing
run: |
curl -O -L --insecure curl -O -L --insecure https://github.com/processing/processing4/releases/download/processing-1292-4.2/processing-4.2-linux-x64.tgz
tar -xzvf processing-4.2-linux-x64.tgz
ls
- name: Move Processing.app to Applications
run: |
mv Processing.app /Applications/Processing.app
- name: Add Processing to PATH
run: |
export PATH=$TRAVIS_BUILD_DIR/temp/processing-4.2:$PATH
- name: Check GITHUB PATH
run: echo $GITHUB_PATH
- name: Test processing-java command
run: |
processing-java --help
- name: Copy libraries to Processing
run: |
mkdir -p $HOME/sketchbook/libraries/
cp -a $GITHUB_WORKSPACE/OpenBCI_GUI/libraries/. $HOME/sketchbook/libraries/
- name: Run Unit Tests
run: |
ls
python $GITHUB_WORKSPACE/GuiUnitTests/run-unittests.py
- name: Build GUI
run: |
mkdir $GITHUB_WORKSPACE/temp
touch temp/timestamp.txt
touch temp/versionstring.txt
python $GITHUB_WORKSPACE/release_script/make-release.py --no-prompts
GUI_COMMIT_TIME=`cat temp/timestamp.txt`
GUI_VERSION_STRING=`cat temp/versionstring.txt`
- 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: Store DMG on AWS
run: |
cd $GITHUB_WORKSPACE
ls
export CURRENT_BRANCH=`git branch --show-current`
export GUI_COMMIT_TIME=`cat temp/timestamp.txt`
export GUI_VERSION_STRING=`cat temp/versionstring.txt`
echo $GUI_COMMIT_TIME
echo $GUI_VERSION_STRING
echo $CURRENT_BRANCH
aws s3 rm s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_macosx.dmg"
aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/${GUI_VERSION_STRING} --recursive --exclude "*" --include "openbcigui_*_macosx.dmg"
aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_macosx.dmg"