-
Notifications
You must be signed in to change notification settings - Fork 258
94 lines (78 loc) · 3.03 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
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: |
mkdir -p $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-linux-x64.tgz
tar -xzvf processing-4.2-linux-x64.tgz
ls
- name: Add Processing to PATH
run: |
export PATH=$GITHUB_WORKSPACE/temp/processing-4.2:$PATH
- name: Check GITHUB PATH
run: echo $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
if: github.event_name == 'workflow_dispatch'
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
if: github.event_name == 'workflow_dispatch'
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_*_linux64.zip"
aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/${GUI_VERSION_STRING} --recursive --exclude "*" --include "openbcigui_*_linux64.zip"
aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_linux64.zip"