Skip to content

Add channel labels for Cyton Digital Channels in GUI CSV #148

Add channel labels for Cyton Digital Channels in GUI CSV

Add channel labels for Cyton Digital Channels in GUI CSV #148

name: Build GUI for macOS
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 macOS
runs-on: macos-latest
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 https://github.com/processing/processing4/releases/download/processing-1292-4.2/processing-4.2-macos-x64.zip
unzip processing-4.2-macos-x64.zip
ls
- name: Move Processing.app to Applications
run: |
mv Processing.app /Applications/Processing.app
- name: Add Processing to PATH
run: |
echo "$GITHUB_WORKSPACE/release_script/mac_only/" >> $GITHUB_PATH
chmod +x $GITHUB_WORKSPACE/release_script/mac_only/processing-java
- 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/Documents/Processing/libraries/
cp -a $GITHUB_WORKSPACE/OpenBCI_GUI/libraries/. $HOME/Documents/Processing/libraries/
- name: Run Unit Tests
run: |
ls
python $GITHUB_WORKSPACE/GuiUnitTests/run-unittests.py
- name: Save Encrypted Certificate to File
run: |
echo $MAC_CERTIFICATE_ENCRYPTED | base64 --decode > $GITHUB_WORKSPACE/release_script/mac_only/Certificates_2023.p12.enc
env:
MAC_CERTIFICATE_ENCRYPTED: ${{ secrets.MAC_CERTIFICATE_ENCRYPTED }}
- name: Decrypt Certificate
run: |
openssl version
openssl enc -aes-256-cbc -a -d -pbkdf2 -in $GITHUB_WORKSPACE/release_script/mac_only/Certificates_2023.p12.enc -out $GITHUB_WORKSPACE/release_script/mac_only/Certificates.p12 -k "$OPENSSL_CERT_K"
env:
OPENSSL_CERT_K: ${{ secrets.OPENSSL_CERT_K }}
- name: Add OSX Signing Certificate to Keychain
uses: apple-actions/import-codesign-certs@v2
with:
p12-filepath: ${{ github.workspace }}/release_script/mac_only/Certificates.p12
p12-password: ${{ secrets.CERTIFICATE_P12_PASSWORD }}
- 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: Get branch names
id: branch-name
uses: tj-actions/branch-names@v7
- name: Store DMG on AWS S3
run: |
cd $GITHUB_WORKSPACE
ls
CURRENT_BRANCH=${{ steps.branch-name.outputs.head_ref_branch }}
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/${CURRENT_BRANCH} --recursive --exclude "*" --include "openbcigui_*_macosx.dmg"
aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/latest --recursive --exclude "*" --include "openbcigui_*_macosx.dmg"