diff --git a/.github/workflows/p3_linux_build_deploy.yml b/.github/workflows/p3_linux_build_deploy.yml new file mode 100644 index 000000000..b179f6c99 --- /dev/null +++ b/.github/workflows/p3_linux_build_deploy.yml @@ -0,0 +1,87 @@ +name: Build GUI for Linux - Processing 3 + +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 Linux - Processing 3 + 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/processing/releases/download/processing-0270-3.5.4/processing-3.5.4-linux64.tgz + tar -xzvf processing-3.5.4-linux64.tgz + ls + + - name: Add Processing to PATH + run: | + sudo su -c "ln -s $GITHUB_WORKSPACE/temp/processing-3.5.4/processing-java /usr/local/bin/processing-java" + + - 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: | + echo "Unit tests cannot be run on Linux without attached display." + echo "https://github.com/processing/processing/wiki/Running-without-a-Display" + + - name: Build GUI + run: | + 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 + 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/processing_3 --recursive --exclude "*" --include "openbcigui_*_linux64.zip" + aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/${CURRENT_BRANCH}/processing_3 --recursive --exclude "*" --include "openbcigui_*_linux64.zip" + aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/latest/processing_3 --recursive --exclude "*" --include "openbcigui_*_linux64.zip" \ No newline at end of file diff --git a/.github/workflows/p3_mac_build_deploy.yml b/.github/workflows/p3_mac_build_deploy.yml new file mode 100644 index 000000000..557c0d263 --- /dev/null +++ b/.github/workflows/p3_mac_build_deploy.yml @@ -0,0 +1,113 @@ +name: Build GUI for macOS - Processing 3 + +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 - Processing 3 + 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/processing/releases/download/processing-0270-3.5.4/processing-3.5.4-macosx.zip + unzip processing-3.5.4-macosx.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/processing_3 --recursive --exclude "*" --include "openbcigui_*_macosx.dmg" + aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/${CURRENT_BRANCH}/processing_3 --recursive --exclude "*" --include "openbcigui_*_macosx.dmg" + aws s3 cp $GITHUB_WORKSPACE/. s3://openbci-public-gui-v6/latest/processing_3 --recursive --exclude "*" --include "openbcigui_*_macosx.dmg" \ No newline at end of file diff --git a/.github/workflows/p3_windows_build_deploy.yml b/.github/workflows/p3_windows_build_deploy.yml new file mode 100644 index 000000000..9fc62beb9 --- /dev/null +++ b/.github/workflows/p3_windows_build_deploy.yml @@ -0,0 +1,133 @@ +name: Build GUI for Windows - Processing 3 + +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 - Processing 3 + 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/processing/releases/download/processing-0270-3.5.4/processing-3.5.4-windows64.zip + ls -l %GITHUB_WORKSPACE%\temp + unzip processing-3.5.4-windows64.zip + ls -l %GITHUB_WORKSPACE%\temp\processing-3.5.4 + 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-3.5.4 >> %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-3.5.4\processing-java.exe --help + shell: cmd + + - name: Check processing-java command + run: | + set PATH=%PATH%;%GITHUB_WORKSPACE%\temp\processing-3.5.4 + processing-java --help + shell: cmd + + - name: Run Unit Tests + run: | + set PATH=%PATH%;%GITHUB_WORKSPACE%\temp\processing-3.5.4 + 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-3.5.4 + 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/processing_3 --recursive --exclude "*" --include "openbcigui_*_windows64.zip" + aws s3 cp ${{ github.workspace }}/. %S3_BRANCH_FOLDER%/processing_3 --recursive --exclude "*" --include "openbcigui_*_windows64.zip" + aws s3 cp ${{ github.workspace }}/. s3://openbci-public-gui-v6/latest/processing_3 --recursive --exclude "*" --include "openbcigui_*_windows64.zip" + shell: cmd \ No newline at end of file diff --git a/.github/workflows/linux_build_deploy.yml b/.github/workflows/p4_linux_build_deploy.yml similarity index 100% rename from .github/workflows/linux_build_deploy.yml rename to .github/workflows/p4_linux_build_deploy.yml diff --git a/.github/workflows/mac_build_deploy.yml b/.github/workflows/p4_mac_build_deploy.yml similarity index 100% rename from .github/workflows/mac_build_deploy.yml rename to .github/workflows/p4_mac_build_deploy.yml diff --git a/.github/workflows/windows_build_deploy.yml b/.github/workflows/p4_windows_build_deploy.yml similarity index 100% rename from .github/workflows/windows_build_deploy.yml rename to .github/workflows/p4_windows_build_deploy.yml diff --git a/.github/workflows/windows_build_test.yml b/.github/workflows/windows_build_test.yml deleted file mode 100644 index 287da405b..000000000 --- a/.github/workflows/windows_build_test.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Build GUI for Windows - Processing 3 - -on: - workflow_dispatch: - pull_request: - branches: - - development - -jobs: - BuildWin: - 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' - - name: Install Python Dependencies - run: | - python -m pip install requests - python -m pip install beautifulsoup4 - - name: Set Path - run: | - echo %GITHUB_WORKSPACE%\temp\processing-3.5.3>>%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: Install Processing - run: | - mkdir %GITHUB_WORKSPACE%\temp - cd %GITHUB_WORKSPACE%\temp - curl -O -L --insecure https://download.processing.org/processing-3.5.3-windows64.zip - ls -l %GITHUB_WORKSPACE%\temp - unzip processing-3.5.3-windows64.zip - ls -l %GITHUB_WORKSPACE%\temp\processing-3.5.3 - 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: Check processing-java - run: processing-java --help - shell: cmd - - name: Build Script - run: | - python %GITHUB_WORKSPACE%\GuiUnitTests\run-unittests.py - 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 - shell: cmd \ No newline at end of file diff --git a/release_script/mac_only/processing-java b/release_script/mac_only/processing-java index a910a586f..d22994d64 100755 --- a/release_script/mac_only/processing-java +++ b/release_script/mac_only/processing-java @@ -10,4 +10,4 @@ do fi done -cd "/Applications/Processing.app/Contents/Java" && /Applications/Processing.app/Contents/PlugIns/jdk-17.0.6+10/Contents/Home/bin/java -Djna.nosys=true $OPTION_FOR_HEADLESS_RUN -cp "ant.jar:ant-launcher.jar:core.jar:jna.jar:flatlaf.jar:pde.jar:jna-platform.jar:core/library/jogl-all.jar:core/library/gluegen-rt.jar:core/library/core.jar:modes/java/mode/com.ibm.icu.jar:modes/java/mode/org.eclipse.core.contenttype.jar:modes/java/mode/org.eclipse.core.jobs.jar:modes/java/mode/org.eclipse.lsp4j.jsonrpc.jar:modes/java/mode/org.eclipse.text.jar:modes/java/mode/org.eclipse.jdt.compiler.apt.jar:modes/java/mode/antlr-4.7.2-complete.jar:modes/java/mode/org.eclipse.core.runtime.jar:modes/java/mode/jdtCompilerAdapter.jar:modes/java/mode/classpath-explorer-1.0.jar:modes/java/mode/org.eclipse.equinox.common.jar:modes/java/mode/gson.jar:modes/java/mode/org.eclipse.lsp4j.jar:modes/java/mode/org.netbeans.swing.outline.jar:modes/java/mode/org.eclipse.osgi.jar:modes/java/mode/JavaMode.jar:modes/java/mode/jsoup-1.7.1.jar:modes/java/mode/antlr.jar:modes/java/mode/org.eclipse.core.resources.jar:modes/java/mode/org.eclipse.jdt.core.jar:modes/java/mode/org.eclipse.equinox.preferences.jar" processing.mode.java.Commander "$@" +cd "/Applications/Processing.app/Contents/Java" && /Applications/Processing.app/Contents/PlugIns/jdk1.8.0_202.jdk/Contents/Home/jre/bin/java -Djna.nosys=true $OPTION_FOR_HEADLESS_RUN -cp "ant.jar:ant-launcher.jar:core.jar:jna.jar:pde.jar:jna-platform.jar:core/library/gluegen-rt-natives-linux-armv6hf.jar:core/library/jogl-all-natives-linux-armv6hf.jar:core/library/gluegen-rt-natives-linux-aarch64.jar:core/library/jogl-all-natives-linux-aarch64.jar:core/library/gluegen-rt-natives-macosx-universal.jar:core/library/gluegen-rt-natives-linux-amd64.jar:core/library/jogl-all-natives-linux-i586.jar:core/library/gluegen-rt-natives-windows-i586.jar:core/library/jogl-all.jar:core/library/gluegen-rt-natives-linux-i586.jar:core/library/jogl-all-natives-linux-amd64.jar:core/library/gluegen-rt.jar:core/library/core.jar:core/library/jogl-all-natives-macosx-universal.jar:core/library/jogl-all-natives-windows-i586.jar:core/library/gluegen-rt-natives-windows-amd64.jar:core/library/jogl-all-natives-windows-amd64.jar:modes/java/mode/com.ibm.icu.jar:modes/java/mode/org.eclipse.core.contenttype.jar:modes/java/mode/org.eclipse.core.jobs.jar:modes/java/mode/org.eclipse.text.jar:modes/java/mode/org.eclipse.core.runtime.jar:modes/java/mode/jdtCompilerAdapter.jar:modes/java/mode/classpath-explorer-1.0.jar:modes/java/mode/jdi.jar:modes/java/mode/org.eclipse.equinox.common.jar:modes/java/mode/org.netbeans.swing.outline.jar:modes/java/mode/org.eclipse.osgi.jar:modes/java/mode/JavaMode.jar:modes/java/mode/jsoup-1.7.1.jar:modes/java/mode/antlr.jar:modes/java/mode/jdimodel.jar:modes/java/mode/org.eclipse.core.resources.jar:modes/java/mode/org.eclipse.jdt.core.jar:modes/java/mode/org.eclipse.equinox.preferences.jar" processing.mode.java.Commander "$@" diff --git a/release_script/mac_only/processing-java-p4 b/release_script/mac_only/processing-java-p4 new file mode 100644 index 000000000..a910a586f --- /dev/null +++ b/release_script/mac_only/processing-java-p4 @@ -0,0 +1,13 @@ +#!/bin/sh + +# Prevents processing-java from stealing focus, see: +# https://github.com/processing/processing/issues/3996. +OPTION_FOR_HEADLESS_RUN="" +for ARG in "$@" +do + if [ "$ARG" = "--build" ]; then + OPTION_FOR_HEADLESS_RUN="-Djava.awt.headless=true" + fi +done + +cd "/Applications/Processing.app/Contents/Java" && /Applications/Processing.app/Contents/PlugIns/jdk-17.0.6+10/Contents/Home/bin/java -Djna.nosys=true $OPTION_FOR_HEADLESS_RUN -cp "ant.jar:ant-launcher.jar:core.jar:jna.jar:flatlaf.jar:pde.jar:jna-platform.jar:core/library/jogl-all.jar:core/library/gluegen-rt.jar:core/library/core.jar:modes/java/mode/com.ibm.icu.jar:modes/java/mode/org.eclipse.core.contenttype.jar:modes/java/mode/org.eclipse.core.jobs.jar:modes/java/mode/org.eclipse.lsp4j.jsonrpc.jar:modes/java/mode/org.eclipse.text.jar:modes/java/mode/org.eclipse.jdt.compiler.apt.jar:modes/java/mode/antlr-4.7.2-complete.jar:modes/java/mode/org.eclipse.core.runtime.jar:modes/java/mode/jdtCompilerAdapter.jar:modes/java/mode/classpath-explorer-1.0.jar:modes/java/mode/org.eclipse.equinox.common.jar:modes/java/mode/gson.jar:modes/java/mode/org.eclipse.lsp4j.jar:modes/java/mode/org.netbeans.swing.outline.jar:modes/java/mode/org.eclipse.osgi.jar:modes/java/mode/JavaMode.jar:modes/java/mode/jsoup-1.7.1.jar:modes/java/mode/antlr.jar:modes/java/mode/org.eclipse.core.resources.jar:modes/java/mode/org.eclipse.jdt.core.jar:modes/java/mode/org.eclipse.equinox.preferences.jar" processing.mode.java.Commander "$@"