diff --git a/.github/workflows/intel_macos_build.yml b/.github/workflows/intel_macos_build.yml
deleted file mode 100644
index fc1def70762..00000000000
--- a/.github/workflows/intel_macos_build.yml
+++ /dev/null
@@ -1,200 +0,0 @@
-name: Intel MacOS Build
-
-env:
- OPENBB_ENABLE_QUICK_EXIT: true
- OPENBB_LOG_COLLECT: false
- OPENBB_USE_ION: false
- OPENBB_USE_PROMPT_TOOLKIT: false
- OPENBB_FILE_OVERWRITE: true
- PIP_DEFAULT_TIMEOUT: 100
- PYTHONNOUSERSITE: 1
-
-on: workflow_dispatch
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
- cancel-in-progress: true
-
-jobs:
- Build:
- name: Intel MacOS Build
- runs-on: [self-hosted, macos, x64]
- steps:
- # Checkout repository main branch. this allows for the commit hashes to line up
- - name: Checkout
- uses: actions/checkout@v3
- - name: Git Log
- run: git log
- # Install create-dmg
- - name: Install create-dmg
- run: brew install create-dmg
- # The following commands to clear previous PATHS and restore to defaults since we have to maintain the instance ourselves
- - name: Clean Previous Path
- run: |
- export PATH=""
- export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
- echo $PATH
- # Set up caching for conda env so that the workflow runs quickly after the first time
- - name: Setup Conda Caching
- uses: actions/cache@v3
- with:
- path: ~/conda_pkgs_dir
- key: conda-macos-3-9-${{ hashFiles('build/conda/conda-3-9-env-full.yaml') }}
- # Set up miniconda using the environment yaml file within the repo
- - name: Setup Miniconda
- uses: conda-incubator/setup-miniconda@v2.2.0
- with:
- miniconda-version: "latest"
- auto-update-conda: true
- channels: conda-forge,defaults
- show-channel-urls: true
- channel-priority: flexible
- environment-file: build/conda/conda-3-9-env-full.yaml
- activate-environment: build_env
- use-only-tar-bz2: true # Needed for caching some reason
- - name: Install requirements
- run: |
- pip list
- python -m pip install -r requirements-full.txt
- - name: Install Specific Papermill
- run: |
- pip list
- pip uninstall papermill -y
- pip install git+https://github.com/nteract/papermill.git@main
- # This is basically the same as build4mac.sh
- - name: Build Bundle
- run: |
- pip list
- python -m PyInstaller build/pyinstaller/terminal.spec --clean
- osascript build/pyinstaller/setup_icons.applescript
- mkdir DMG
- cp -r build/pyinstaller/macOS_package_assets/* DMG/
- mv dist/OpenBBTerminal DMG/OpenBB\ Terminal/.OpenBB
- - name: Creating Keychain
- env:
- MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
- MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
- MACOS_KEYCHAIN_PWD: ${{ secrets.MACOS_KEYCHAIN_PWD }}
- MACOS_CODESIGN_IDENTITY: ${{ secrets.MACOS_CODESIGN_IDENTITY }}
- run: | # when pushing to main, make to generate new cert, and utilize secrets to store new password, and identity
- echo "Decoding"
- echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
- echo "Creating Keychain"
- security create-keychain -p $MACOS_KEYCHAIN_PWD build.keychain
- echo "Setting Default Keychain"
- security default-keychain -s build.keychain
- echo "Unlocking Keychain"
- security unlock-keychain -p $MACOS_KEYCHAIN_PWD build.keychain
- echo "Importing Keychain"
- security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
- echo "Setting Partition List"
- security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $MACOS_KEYCHAIN_PWD build.keychain
- - name: Codesign Specific Binaries
- env:
- MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
- MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
- MACOS_KEYCHAIN_PWD: ${{ secrets.MACOS_KEYCHAIN_PWD }}
- MACOS_CODESIGN_IDENTITY: ${{ secrets.MACOS_CODESIGN_IDENTITY }}
- run: |
- echo "Code Signing SO Files"
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/*.so
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/*/*.so
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/*/*/*.so
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/*/*/*/*.so
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/*/*/*/*/*.so
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/*/*/*/*/*/*.so
- echo "Code Signing DYLIB Files"
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/*.dylib
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/*/*.dylib
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/*/*/*.dylib
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/*/*/*/*/*.dylib
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/prophet/.dylibs/*.dylib
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/prophet/stan_model/cmdstan-2.26.1/stan/lib/stan_math/lib/tbb/*.dylib
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/torch/.dylibs/*.dylib
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/sklearn/.dylibs/*.dylib
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/scipy/.dylibs/*.dylib
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/xgboost/.dylibs/*.dylib
-
- echo "Code Signing Other Files"
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/prophet/stan_model/prophet_model.bin
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/prophet/stan_model/cmdstan-2.26.1/bin/diagnose
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/prophet/stan_model/cmdstan-2.26.1/bin/print
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/prophet/stan_model/cmdstan-2.26.1/bin/stanc
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/prophet/stan_model/cmdstan-2.26.1/bin/stansummary
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/pyarrow/plasma-store-server
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/torch/bin/protoc
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/torch/bin/protoc-3.13.0.0
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/torch/bin/torch_shm_manager
- echo "Code Sign OpenBB Executable File"
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/OpenBBTerminal
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/OpenBBPlotsBackend
- - name: Create DMG
- run: create-dmg --volname "OpenBB Terminal" --volicon "images/dmg_volume.icns" --background "images/openbb_dmg_background.png" --icon "OpenBB Terminal" 190 250 --window-pos 190 120 --window-size 800 400 --icon-size 100 --text-size 14 --app-drop-link 600 250 --eula LICENSE --format UDZO --no-internet-enable "OpenBB Terminal".dmg DMG
- - name: Code Sign DMG Installer
- env:
- MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
- MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
- MACOS_KEYCHAIN_PWD: ${{ secrets.MACOS_KEYCHAIN_PWD }}
- MACOS_CODESIGN_IDENTITY: ${{ secrets.MACOS_CODESIGN_IDENTITY }}
- run: |
- echo "Code Signing DMG Installer"
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY OpenBB\ Terminal.dmg
- echo "Verify Signing"
- codesign --verify --deep --strict --verbose=2 OpenBB\ Terminal.dmg
- - name: Deleting Previous Keychain
- run: |
- echo "Deleting Previous Keychain to Clean Instance"
- rm -rf /Users/openbb/Library/Keychains/build.keychain-db
- - name: Clean up Build Artifacts
- run: |
- rm -rf build/terminal
- rm -rf dist
- rm -rf DMG
- - name: Notarize DMG
- env:
- NOTARIZE_APPLE_ID: ${{ secrets.NOTARIZE_APPLE_ID }}
- NOTARIZE_APPLE_PWD: ${{ secrets.NOTARIZE_APPLE_PWD }}
- NOTARIZE_APPLE_TEAM_ID: ${{ secrets.NOTARIZE_APPLE_TEAM_ID }}
- run: |
- xcrun notarytool submit OpenBB\ Terminal.dmg --apple-id "$NOTARIZE_APPLE_ID" --password "$NOTARIZE_APPLE_PWD" --team-id "$NOTARIZE_APPLE_TEAM_ID" --wait
- - name: Staple
- run: |
- xcrun stapler staple "OpenBB Terminal.dmg"
- - name: Save Build Artifact DMG
- uses: actions/upload-artifact@v3
- with:
- name: Intel MacOS DMG Artifact
- path: OpenBB\ Terminal.dmg
- - name: Convert & Mount DMG
- run: | # Remove the converting disc image at the end
- hdiutil convert OpenBB\ Terminal.dmg -format UDTO -o openbbterminal.cdr
- hdiutil attach openbbterminal.cdr
- rm -rf openbbterminal.cdr
- - name: Directory Change
- run: |
- cd
- cd /Volumes/OpenBB\ Terminal
- ls
- cp -R OpenBB\ Terminal ~/Desktop
- - name: Unmount DMG
- run: hdiutil detach /dev/disk2
-
- - name: Run Integration Tests
- run: |
- /Users/openbb/Desktop/OpenBB\ Terminal/.OpenBB/OpenBBTerminal -t -s forecast cryptocurrency reports alternative economy futures econometrics dashboards portfolio stocks/test_stocks_options_screen.openbb stocks/test_stocks_options.openbb forex etf stocks/test_stocks_fa.openbb > result.txt
- cat result.txt
- grep "================================ integration test summary ================================" result.txt -A100 | tail --bytes=2000 > failed_tests.txt
-
- - name: Upload summary to Slack
- uses: adrey/slack-file-upload-action@master
- with:
- token: ${{ secrets.SLACK_API_TOKEN }}
- initial_comment: "Intel MacOs Build Integration test summary"
- title: "Intel MacOs Build Integration test summary"
- path: failed_tests.txt
- channel: ${{ secrets.SLACK_CHANNEL_ID }}
-
- - name: Remove OpenBB Folder
- run: rm -rf /Users/openbb/Desktop/OpenBB\ Terminal
- - name: Remove OpenBB Exports Folder
- run: rm -rf ~/Desktop/OPENBB-exports
diff --git a/.github/workflows/m1_macos_build.yml b/.github/workflows/m1_macos_build.yml
deleted file mode 100644
index cb30f0b39d1..00000000000
--- a/.github/workflows/m1_macos_build.yml
+++ /dev/null
@@ -1,205 +0,0 @@
-name: M1 MacOS Build
-
-env:
- OPENBB_ENABLE_QUICK_EXIT: true
- OPENBB_LOG_COLLECT: false
- OPENBB_USE_ION: false
- OPENBB_USE_PROMPT_TOOLKIT: false
- OPENBB_FILE_OVERWRITE: true
- PIP_DEFAULT_TIMEOUT: 100
- PYTHONNOUSERSITE: 1
-
-on: workflow_dispatch
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
- cancel-in-progress: true
-
-jobs:
- Build:
- name: M1 MacOS Build
- runs-on: [self-hosted, macos, ARM64]
- steps:
- # Checkout repository main branch. this allows for the commit hashes to line up
- - name: Checkout
- uses: actions/checkout@v3
- - name: Git Log
- run: git log
- # Install create-dmg
- - name: Install create-dmg
- run: brew install create-dmg
- # The following commands to clear previous PATHS and restore to defaults since we have to maintain the instance ourselves
- - name: Clean Previous Path
- run: |
- export PATH=""
- export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
- echo $PATH
- # Set up caching for conda env so that the workflow runs quickly after the first time
- - name: Setup Conda Caching
- uses: actions/cache@v3
- with:
- path: ~/conda_pkgs_dir
- key: conda-macos-3-9-${{ hashFiles('build/conda/conda-3-9-env-full.yaml') }}
- # Set up miniconda using the environment yaml file within the repo
- - name: Setup Miniconda
- uses: conda-incubator/setup-miniconda@v2.2.0
- with:
- miniconda-version: "latest"
- auto-update-conda: true
- channels: conda-forge,defaults
- show-channel-urls: true
- channel-priority: flexible
- environment-file: build/conda/conda-3-9-env-full.yaml
- activate-environment: build_env
- auto-activate-base: false
- use-only-tar-bz2: true # Needed for caching some reason
-
- - name: Run Poetry
- run: |
- pip list
- python -m pip install -r requirements-full.txt
-
- - name: Install Specific Papermill
- run: |
- pip uninstall papermill -y
- pip install git+https://github.com/nteract/papermill.git@main
-
- # This is basically the same as build4mac.sh
- - name: Build Bundle
- run: |
- python -m PyInstaller build/pyinstaller/terminal.spec --clean
- osascript build/pyinstaller/setup_icons.applescript
- mkdir DMG
- cp -r build/pyinstaller/macOS_package_assets/* DMG/
- mv dist/OpenBBTerminal DMG/OpenBB\ Terminal/.OpenBB
- - name: Creating Keychain
- env:
- MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
- MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
- MACOS_KEYCHAIN_PWD: ${{ secrets.MACOS_KEYCHAIN_PWD }}
- MACOS_CODESIGN_IDENTITY: ${{ secrets.MACOS_CODESIGN_IDENTITY }}
- run: | # when pushing to main, make to generate new cert, and utilize secrets to store new password, and identity
- echo "Ensuring Keychain with same name does not exist"
- rm -rf /Users/openbb/Library/Keychains/build.keychain-db
- echo "Decoding certificate"
- echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
- echo "Creating Keychain"
- security create-keychain -p $MACOS_KEYCHAIN_PWD build.keychain
- echo "Setting Default Keychain"
- security default-keychain -s build.keychain
- echo "Unlocking Keychain"
- security unlock-keychain -p $MACOS_KEYCHAIN_PWD build.keychain
- echo "Importing Keychain"
- security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
- echo "Setting Partition List"
- security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $MACOS_KEYCHAIN_PWD build.keychain
- - name: Codesign Specific Binaries
- env:
- MACOS_CODESIGN_IDENTITY: ${{ secrets.MACOS_CODESIGN_IDENTITY }}
- run: |
- echo "Code Signing SO Files"
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/*.so
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/*/*.so
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/*/*/*.so
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/*/*/*/*.so
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/*/*/*/*/*.so
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/*/*/*/*/*/*.so
- echo "Code Signing DYLIB Files"
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/*.dylib
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/*/*.dylib
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/*/*/*.dylib
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/*/*/*/*/*.dylib
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/prophet/.dylibs/*.dylib
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/prophet/stan_model/cmdstan-2.26.1/stan/lib/stan_math/lib/tbb/*.dylib
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/torch/.dylibs/*.dylib
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/sklearn/.dylibs/*.dylib
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/scipy/.dylibs/*.dylib
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/xgboost/.dylibs/*.dylib
- echo "Code Signing Other Files"
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/prophet/stan_model/prophet_model.bin
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/prophet/stan_model/cmdstan-2.26.1/bin/diagnose
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/prophet/stan_model/cmdstan-2.26.1/bin/print
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/prophet/stan_model/cmdstan-2.26.1/bin/stanc
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/prophet/stan_model/cmdstan-2.26.1/bin/stansummary
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/pyarrow/plasma-store-server
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/torch/bin/protoc
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/torch/bin/protoc-3.13.0.0
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/torch/bin/torch_shm_manager
- echo "Code Sign OpenBB Executable File"
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/OpenBBTerminal
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY DMG/OpenBB\ Terminal/.OpenBB/OpenBBPlotsBackend
- - name: Create DMG
- run: create-dmg --volname "OpenBB Terminal" --volicon "images/dmg_volume.icns" --background "images/openbb_dmg_background.png" --icon "OpenBB Terminal" 190 250 --window-pos 190 120 --window-size 800 400 --icon-size 100 --text-size 14 --app-drop-link 600 250 --eula LICENSE --format UDZO --no-internet-enable "OpenBB Terminal".dmg DMG
- - name: Code Sign DMG Installer
- env:
- MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
- MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
- MACOS_KEYCHAIN_PWD: ${{ secrets.MACOS_KEYCHAIN_PWD }}
- MACOS_CODESIGN_IDENTITY: ${{ secrets.MACOS_CODESIGN_IDENTITY }}
- run: |
- echo "Code Signing DMG Installer"
- /usr/bin/codesign --deep --force --verify --verbose --options runtime --entitlements "build/pyinstaller/entitlements.plist" -s $MACOS_CODESIGN_IDENTITY OpenBB\ Terminal.dmg
- echo "Verify Signing"
- codesign --verify --deep --strict --verbose=2 OpenBB\ Terminal.dmg
- - name: Deleting Previous Keychain
- run: |
- echo "Deleting Previous Keychain to Clean Instance"
- rm -rf /Users/openbb/Library/Keychains/build.keychain-db
- - name: Clean up Build Artifacts
- run: |
- rm -rf build/terminal
- rm -rf dist
- rm -rf DMG
- - name: Notorize DMG
- env:
- NOTARIZE_APPLE_ID: ${{ secrets.NOTARIZE_APPLE_ID }}
- NOTARIZE_APPLE_PWD: ${{ secrets.NOTARIZE_APPLE_PWD }}
- NOTARIZE_APPLE_TEAM_ID: ${{ secrets.NOTARIZE_APPLE_TEAM_ID }}
- run: |
- xcrun notarytool submit OpenBB\ Terminal.dmg --apple-id "$NOTARIZE_APPLE_ID" --password "$NOTARIZE_APPLE_PWD" --team-id "$NOTARIZE_APPLE_TEAM_ID" --wait
- - name: Staple
- run: |
- xcrun stapler staple "OpenBB Terminal.dmg"
- - name: Clean up Build Artifacts
- run: |
- rm -rf build/terminal
- rm -rf dist
- rm -rf DMG
- - name: Save Build Artifact DMG
- uses: actions/upload-artifact@v3
- with:
- name: M1 MacOS DMG Artifact
- path: OpenBB\ Terminal.dmg
- - name: Convert & Mount DMG
- run: |
- hdiutil convert OpenBB\ Terminal.dmg -format UDTO -o openbbterminal.cdr
- hdiutil attach openbbterminal.cdr
- rm -rf openbbterminal.cdr
- - name: Directory Change
- run: |
- cd
- cd /Volumes/OpenBB\ Terminal
- ls
- cp -R OpenBB\ Terminal ~/Desktop
- - name: Unmount DMG
- run: hdiutil detach /dev/disk4
-
- - name: Run Integration Tests
- run: |
- /Users/openbb/Desktop/OpenBB\ Terminal/.OpenBB/OpenBBTerminal -t -s forecast cryptocurrency reports alternative economy futures econometrics dashboards portfolio stocks/test_stocks_options_screen.openbb stocks/test_stocks_options.openbb forex etf stocks/test_stocks_fa.openbb > result.txt
- cat result.txt
- grep "================================ integration test summary ================================" result.txt -A100 | tail --bytes=2000 > failed_tests.txt
-
- - name: Upload summary to Slack
- uses: adrey/slack-file-upload-action@master
- with:
- token: ${{ secrets.SLACK_API_TOKEN }}
- initial_comment: "M1 MacOs Build Integration test summary"
- title: "M1 MacOs Build Integration test summary"
- path: failed_tests.txt
- channel: ${{ secrets.SLACK_CHANNEL_ID }}
-
- - name: Remove OpenBB Folder
- run: rm -rf /Users/openbb/Desktop/OpenBB\ Terminal
- - name: Remove OpenBB Exports Folder
- run: rm -rf ~/Desktop/OPENBB-exports
diff --git a/.github/workflows/macos_build.yml b/.github/workflows/macos_build.yml
new file mode 100644
index 00000000000..8543f9ebe0e
--- /dev/null
+++ b/.github/workflows/macos_build.yml
@@ -0,0 +1,155 @@
+name: MacOS Build
+
+env:
+ OPENBB_ENABLE_QUICK_EXIT: true
+ OPENBB_LOG_COLLECT: false
+ OPENBB_USE_ION: false
+ OPENBB_USE_PROMPT_TOOLKIT: false
+ OPENBB_FILE_OVERWRITE: true
+ PIP_DEFAULT_TIMEOUT: 100
+ PYTHONNOUSERSITE: 1
+
+on: workflow_dispatch
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ Build:
+ name: MacOS Build
+ runs-on: ${{ matrix.items.os }}
+ strategy:
+ matrix:
+ items: [
+ {os: [self-hosted, macos, ARM64], name: "OpenBBM1.pkg"},
+ {os: [self-hosted, macos, x64], name: "OpenBBIntel.pkg"}
+ ]
+ steps:
+ # Checkout repository main branch. this allows for the commit hashes to line up
+ - name: Checkout
+ uses: actions/checkout@v3
+ - name: Git Log
+ run: git log
+ # The following commands to clear previous PATHS and restore to defaults since we have to maintain the instance ourselves
+ - name: Clean Previous Path
+ run: |
+ export PATH=""
+ export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
+ echo $PATH
+ # Set up caching for conda env so that the workflow runs quickly after the first time
+ - name: Setup Conda Caching
+ uses: actions/cache@v3
+ with:
+ path: ~/conda_pkgs_dir
+ key: conda-macos-3-9-${{ hashFiles('build/conda/conda-3-9-env-full.yaml') }}
+ # Set up miniconda using the environment yaml file within the repo
+ - name: Setup Miniconda
+ uses: conda-incubator/setup-miniconda@v2.2.0
+ with:
+ miniconda-version: "latest"
+ auto-update-conda: true
+ channels: conda-forge,defaults
+ show-channel-urls: true
+ channel-priority: flexible
+ environment-file: build/conda/conda-3-9-env-full.yaml
+ activate-environment: build_env
+ auto-activate-base: false
+ use-only-tar-bz2: true # Needed for caching some reason
+
+ - name: Install Dependencies
+ run: |
+ pip list
+ python -m pip install -r requirements-full.txt
+ pip install openbb
+
+ - name: Build Bundle
+ run: build/pyinstaller/build4mac.sh
+ shell: bash
+ - name: Creating Application Keychain
+ env:
+ MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
+ MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
+ MACOS_KEYCHAIN_PWD: ${{ secrets.MACOS_KEYCHAIN_PWD }}
+ MACOS_CODESIGN_IDENTITY: ${{ secrets.MACOS_CODESIGN_IDENTITY }}
+ run: | # when pushing to main, make to generate new cert, and utilize secrets to store new password, and identity
+ echo "Ensuring Keychain with same name does not exist"
+ rm -rf /Users/openbb/Library/Keychains/build.keychain-db
+ echo "Decoding certificate"
+ echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
+ echo "Creating Keychain"
+ security create-keychain -p $MACOS_KEYCHAIN_PWD build.keychain
+ echo "Setting Default Keychain"
+ security default-keychain -s build.keychain
+ echo "Unlocking Keychain"
+ security unlock-keychain -p $MACOS_KEYCHAIN_PWD build.keychain
+ echo "Importing Keychain"
+ security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
+ echo "Setting Partition List"
+ security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $MACOS_KEYCHAIN_PWD build.keychain
+ - name: Create Signed Package
+ env:
+ APPLE_DEVELOPER_CERTIFICATE_ID: ${{ secrets.MACOS_INSTALLER_CODESIGN_IDENTITY }}
+ MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
+ MACOS_KEYCHAIN_PWD: ${{ secrets.MACOS_KEYCHAIN_PWD }}
+ MACOS_INSTALLER_KEYCHAIN_PWD: ${{ secrets.MACOS_INSTALLER_KEYCHAIN_PWD }}
+ APPLE_SIGNING_IDENTITY: ${{ secrets.MACOS_CODESIGN_IDENTITY }}
+ run: |
+ security unlock-keychain -p $MACOS_INSTALLER_KEYCHAIN_PWD install.keychain
+ build/pyinstaller/macOS/build-macos.sh OpenBBTerminal 0.0.1
+ mv build/pyinstaller/macOS/target/pkg/OpenBBTerminalM1.pkg OpenBBTerminalM1.pkg
+ shell: bash
+ - name: Deleting Previous Keychain
+ run: |
+ echo "Deleting Previous Keychain to Clean Instance"
+ rm -rf /Users/openbb/Library/Keychains/build.keychain-db
+ - name: Clean up Build Artifacts
+ run: |
+ rm -rf build/terminal
+ rm -rf dist
+ rm -rf DMG
+ - name: Notorize DMG
+ env:
+ NOTARIZE_APPLE_ID: ${{ secrets.NOTARIZE_APPLE_ID }}
+ NOTARIZE_APPLE_PWD: ${{ secrets.NOTARIZE_APPLE_PWD }}
+ NOTARIZE_APPLE_TEAM_ID: ${{ secrets.NOTARIZE_APPLE_TEAM_ID }}
+ run: |
+ xcrun notarytool submit OpenBBTerminalM1.pkg --apple-id "$NOTARIZE_APPLE_ID" --password "$NOTARIZE_APPLE_PWD" --team-id "$NOTARIZE_APPLE_TEAM_ID" --wait
+ - name: Staple
+ run: |
+ xcrun stapler staple OpenBBTerminalM1.pkg
+ - name: Clean up Build Artifacts
+ run: |
+ rm -rf build/terminal
+ rm -rf dist
+ rm -rf DMG
+ - name: Save Build Artifact PKG
+ uses: actions/upload-artifact@v3
+ with:
+ name: ${{ matrix.items.name }}
+ path: OpenBBTerminalM1.pkg
+ - name: Get contents from PkgUtil
+ run: |
+ pkgutil --expand-full OpenBBTerminalM1.pkg extract/
+ rm -rf OpenBBTerminalM1.pkg
+
+ - name: Run Integration Tests
+ run: |
+ extract/OpenBBTerminal.pkg/Payload/Applications/OpenBB\ Terminal/.OpenBB/OpenBBTerminal -t -s forecast cryptocurrency reports alternative economy futures econometrics dashboards portfolio stocks/test_stocks_options_screen.openbb stocks/test_stocks_options.openbb forex etf stocks/test_stocks_fa.openbb > result.txt
+ cat result.txt
+ grep "================================ integration test summary ================================" result.txt -A100 | tail --bytes=2000 > failed_tests.txt
+
+ - name: Upload summary to Slack
+ uses: adrey/slack-file-upload-action@master
+ with:
+ token: ${{ secrets.SLACK_API_TOKEN }}
+ initial_comment: "M1 MacOs Build Integration test summary"
+ title: "M1 MacOs Build Integration test summary"
+ path: failed_tests.txt
+ channel: ${{ secrets.SLACK_CHANNEL_ID }}
+
+ - name: Remove OpenBB Folder
+ run: |
+ rm -rf /Users/openbb/Desktop/OpenBB\ Terminal
+ rm -rf ~/Desktop/OPENBB-exports
+ rm -rf extract/
diff --git a/build/pyinstaller/build4mac.sh b/build/pyinstaller/build4mac.sh
index bb8ed69c1b4..5f6758be10f 100755
--- a/build/pyinstaller/build4mac.sh
+++ b/build/pyinstaller/build4mac.sh
@@ -1,6 +1,8 @@
#!/bin/bash
DISK_IMAGE_NAME="OpenBB Terminal"
+SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
+BUNDLER_PATH="$SCRIPTPATH/macOS/build-macos.sh"
# exit when any command fails
set -e
@@ -12,7 +14,7 @@ rm -rf build/terminal && rm -rf dist && rm -rf DMG
rm -rf openbb_terminal/logs
# Running build
-pyinstaller build/pyinstaller/terminal.spec --clean
+pyinstaller build/pyinstaller/terminal.spec # --clean
# Assign icons to the built folder and launcher
osascript build/pyinstaller/setup_icons.applescript
@@ -23,41 +25,3 @@ mkdir DMG
# Copy relevant artifacts to the packaging folder
cp -r build/pyinstaller/macOS_package_assets/* DMG/
mv dist/OpenBBTerminal DMG/"$DISK_IMAGE_NAME"/.OpenBB
-
-osascript build/pyinstaller/setup_icons_post.applescript
-
-# Create a DMG with create-dmg
-#
-# NOTE:
-# Code signing and notarization requires adding the following:
-#
-# --codesign "Common name of the Developer certificate"
-# --format UDIF
-# --notarize "Notarization identity " see:
-# https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/customizing_the_notarization_workflow
-
-if ! command -v create-dmg &> /dev/null
-then
- echo "create could not be found"
- echo "install create-dmg from brew or github"
- exit
-fi
-
-create-dmg \
- --volname "OpenBB Terminal" \
- --volicon "images/dmg_volume.icns" \
- --background "images/openbb_dmg_background.png" \
- --icon "OpenBB Terminal" 190 250 \
- --window-pos 190 120 \
- --window-size 800 400 \
- --icon-size 100 \
- --text-size 14 \
- --app-drop-link 600 250 \
- --eula LICENSE \
- --format UDZO \
- --no-internet-enable \
- "OpenBB Terminal".dmg DMG
-
-
-# Clean Up artifacts from this build
-rm -rf build/terminal && rm -rf dist && rm -rf DMG
diff --git a/build/pyinstaller/macOS/.gitignore b/build/pyinstaller/macOS/.gitignore
new file mode 100644
index 00000000000..2f7896d1d13
--- /dev/null
+++ b/build/pyinstaller/macOS/.gitignore
@@ -0,0 +1 @@
+target/
diff --git a/build/pyinstaller/macOS/build-macos.sh b/build/pyinstaller/macOS/build-macos.sh
new file mode 100755
index 00000000000..2a29a422523
--- /dev/null
+++ b/build/pyinstaller/macOS/build-macos.sh
@@ -0,0 +1,215 @@
+#!/bin/bash
+
+#Parameters
+SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
+TARGET_DIRECTORY="$SCRIPTPATH/target"
+BASE_DIRECTORY="$( cd -- "$(dirname "$1")" >/dev/null 2>&1 ; pwd -P )"
+APP_DIRECTORY="$BASE_DIRECTORY/DMG/OpenBB Terminal"
+BINARIES="$BASE_DIRECTORY/DMG/OpenBB\ Terminal/.OpenBB"
+ENTITLEMENTS="$BASE_DIRECTORY/build/pyinstaller/entitlements.plist"
+PRODUCT=${1}
+VERSION=${2}
+DATE=`date +%Y-%m-%d`
+TIME=`date +%H:%M:%S`
+LOG_PREFIX="[$DATE $TIME]"
+
+
+function printUsage() {
+ echo -e "\033[1mUsage:\033[0m"
+ echo "$0 [APPLICATION_NAME] [APPLICATION_VERSION]"
+ echo
+ echo -e "\033[1mOptions:\033[0m"
+ echo " -h (--help)"
+ echo
+ echo -e "\033[1mExample::\033[0m"
+ echo "$0 openbbpro 0.0.1"
+
+}
+
+#Argument validation
+if [ -z "$APPLE_DEVELOPER_CERTIFICATE_ID" ]; then
+ echo "APPLE_DEVELOPER_CERTIFICATE_ID environment variable is not set"
+ echo "Please run 'security find-identity -v', and then use the value for"
+ echo "the developer ID Installer (and NOT the Developer ID Application)"
+ exit 1
+fi
+if [[ "$1" == "-h" || "$1" == "--help" ]]; then
+ printUsage
+ exit 1
+fi
+if [ -z "$1" ]; then
+ echo "Please enter a valid application name for your application"
+ echo
+ printUsage
+ exit 1
+else
+ echo "Application Name : $1"
+fi
+if [[ "$2" =~ [0-9]+.[0-9]+.[0-9]+ ]]; then
+ echo "Application Version : $2"
+else
+ echo "Please enter a valid version for your application (format [0-9].[0-9].[0-9])"
+ echo
+ printUsage
+ exit 1
+fi
+if [ -z "$APPLE_SIGNING_IDENTITY" ]; then
+ echo "Please set the APPLE_SIGNING_IDENTITY environment variable"
+ exit 1
+fi
+
+#Functions
+go_to_dir() {
+ pushd $1 >/dev/null 2>&1
+}
+
+log_info() {
+ echo "${LOG_PREFIX}[INFO]" $1
+}
+
+log_warn() {
+ echo "${LOG_PREFIX}[WARN]" $1
+}
+
+log_error() {
+ echo "${LOG_PREFIX}[ERROR]" $1
+}
+
+deleteInstallationDirectory() {
+ log_info "Cleaning $TARGET_DIRECTORY directory."
+ rm -rf "$TARGET_DIRECTORY"
+
+ if [[ $? != 0 ]]; then
+ log_error "Failed to clean $TARGET_DIRECTORY directory" $?
+ exit 1
+ fi
+}
+
+signFiles() {
+ codesign --deep --force --verify --verbose --options runtime --entitlements "$ENTITLEMENTS" -s "$APPLE_SIGNING_IDENTITY" build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/*.so
+ codesign --deep --force --verify --verbose --options runtime --entitlements "$ENTITLEMENTS" -s "$APPLE_SIGNING_IDENTITY" build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/*/*.so
+ codesign --deep --force --verify --verbose --options runtime --entitlements "$ENTITLEMENTS" -s "$APPLE_SIGNING_IDENTITY" build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/*/*/*.so
+ codesign --deep --force --verify --verbose --options runtime --entitlements "$ENTITLEMENTS" -s "$APPLE_SIGNING_IDENTITY" build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/*/*/*/*.so
+ codesign --deep --force --verify --verbose --options runtime --entitlements "$ENTITLEMENTS" -s "$APPLE_SIGNING_IDENTITY" build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/*/*/*/*/*.so
+ codesign --deep --force --verify --verbose --options runtime --entitlements "$ENTITLEMENTS" -s "$APPLE_SIGNING_IDENTITY" build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/*/*/*/*/*/*.so
+ echo "Code Signing DYLIB Files"
+ codesign --deep --force --verify --verbose --options runtime --entitlements "$ENTITLEMENTS" -s "$APPLE_SIGNING_IDENTITY" build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/*.dylib
+ codesign --deep --force --verify --verbose --options runtime --entitlements "$ENTITLEMENTS" -s "$APPLE_SIGNING_IDENTITY" build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/*.dylib
+ codesign --deep --force --verify --verbose --options runtime --entitlements "$ENTITLEMENTS" -s "$APPLE_SIGNING_IDENTITY" build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/*/*/*.dylib
+ codesign --deep --force --verify --verbose --options runtime --entitlements "$ENTITLEMENTS" -s "$APPLE_SIGNING_IDENTITY" build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/*/*/*/*/*.dylib
+ codesign --deep --force --verify --verbose --options runtime --entitlements "$ENTITLEMENTS" -s "$APPLE_SIGNING_IDENTITY" build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/pyarrow/*.dylib
+ codesign --deep --force --verify --verbose --options runtime --entitlements "$ENTITLEMENTS" -s "$APPLE_SIGNING_IDENTITY" build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/prophet/.dylibs/*.dylib
+ codesign --deep --force --verify --verbose --options runtime --entitlements "$ENTITLEMENTS" -s "$APPLE_SIGNING_IDENTITY" build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/scipy/.dylibs/*.dylib
+ codesign --deep --force --verify --verbose --options runtime --entitlements "$ENTITLEMENTS" -s "$APPLE_SIGNING_IDENTITY" build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/xgboost/.dylibs/*.dylib
+ codesign --deep --force --verify --verbose --options runtime --entitlements "$ENTITLEMENTS" -s "$APPLE_SIGNING_IDENTITY" build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/prophet/stan_model/cmdstan-2.26.1/stan/lib/stan_math/lib/tbb/*.dylib
+ codesign --deep --force --verify --verbose --options runtime --entitlements "$ENTITLEMENTS" -s "$APPLE_SIGNING_IDENTITY" build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/torch/.dylibs/*.dylib
+ codesign --deep --force --verify --verbose --options runtime --entitlements "$ENTITLEMENTS" -s "$APPLE_SIGNING_IDENTITY" build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/sklearn/.dylibs/*.dylib
+ echo "Coce Signing LIB Files"
+ codesign --deep --force --verify --verbose --options runtime --entitlements "$ENTITLEMENTS" -s "$APPLE_SIGNING_IDENTITY" build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/*.lib
+ echo "Code Signing Other Files"
+ codesign --deep --force --verify --verbose --options runtime --entitlements "$ENTITLEMENTS" -s "$APPLE_SIGNING_IDENTITY" build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/prophet/stan_model/prophet_model.bin
+ codesign --deep --force --verify --verbose --options runtime --entitlements "$ENTITLEMENTS" -s "$APPLE_SIGNING_IDENTITY" build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/prophet/stan_model/cmdstan-2.26.1/bin/diagnose
+ codesign --deep --force --verify --verbose --options runtime --entitlements "$ENTITLEMENTS" -s "$APPLE_SIGNING_IDENTITY" build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/prophet/stan_model/cmdstan-2.26.1/bin/print
+ codesign --deep --force --verify --verbose --options runtime --entitlements "$ENTITLEMENTS" -s "$APPLE_SIGNING_IDENTITY" build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/prophet/stan_model/cmdstan-2.26.1/bin/stanc
+ codesign --deep --force --verify --verbose --options runtime --entitlements "$ENTITLEMENTS" -s "$APPLE_SIGNING_IDENTITY" build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/prophet/stan_model/cmdstan-2.26.1/bin/stansummary
+ codesign --deep --force --verify --verbose --options runtime --entitlements "$ENTITLEMENTS" -s "$APPLE_SIGNING_IDENTITY" build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/pyarrow/plasma-store-server
+ codesign --deep --force --verify --verbose --options runtime --entitlements "$ENTITLEMENTS" -s "$APPLE_SIGNING_IDENTITY" build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/torch/bin/protoc
+ codesign --deep --force --verify --verbose --options runtime --entitlements "$ENTITLEMENTS" -s "$APPLE_SIGNING_IDENTITY" build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/torch/bin/protoc-3.13.0.0
+ codesign --deep --force --verify --verbose --options runtime --entitlements "$ENTITLEMENTS" -s "$APPLE_SIGNING_IDENTITY" build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/torch/bin/torch_shm_manager
+ echo "Code Sign OpenBB Executable File"
+ codesign --deep --force --verify --verbose --options runtime --entitlements "$ENTITLEMENTS" -s "$APPLE_SIGNING_IDENTITY" build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/OpenBBTerminal
+ codesign --deep --force --verify --verbose --options runtime --entitlements "$ENTITLEMENTS" -s "$APPLE_SIGNING_IDENTITY" build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/OpenBBPlotsBackend
+}
+
+createInstallationDirectory() {
+ if [ -d "${TARGET_DIRECTORY}" ]; then
+ deleteInstallationDirectory
+ fi
+ mkdir -pv "$TARGET_DIRECTORY"
+
+ if [[ $? != 0 ]]; then
+ log_error "Failed to create $TARGET_DIRECTORY directory" $?
+ exit 1
+ fi
+}
+
+copyDarwinDirectory(){
+ createInstallationDirectory
+ cp -r "$SCRIPTPATH/darwin" "${TARGET_DIRECTORY}/"
+ chmod -R 755 "${TARGET_DIRECTORY}/darwin/scripts"
+ chmod -R 755 "${TARGET_DIRECTORY}/darwin/Resources"
+ chmod 755 "${TARGET_DIRECTORY}/darwin/Distribution"
+}
+
+# This creates the target/darwin folder which contains the contents for formatting the installer
+# It also created the target/darkwinpkg folder which has the .app to install
+copyBuildDirectory() {
+ sed -i '' -e 's/__VERSION__/'${VERSION}'/g' "${TARGET_DIRECTORY}/darwin/scripts/postinstall"
+ sed -i '' -e 's/__PRODUCT__/'${PRODUCT}'/g' "${TARGET_DIRECTORY}/darwin/scripts/postinstall"
+ chmod -R 755 "${TARGET_DIRECTORY}/darwin/scripts/postinstall"
+
+ sed -i '' -e 's/__VERSION__/'${VERSION}'/g' "${TARGET_DIRECTORY}/darwin/Distribution"
+ sed -i '' -e 's/__PRODUCT__/'${PRODUCT}'/g' "${TARGET_DIRECTORY}/darwin/Distribution"
+ chmod -R 755 "${TARGET_DIRECTORY}/darwin/Distribution"
+
+ sed -i '' -e 's/__VERSION__/'${VERSION}'/g' "${TARGET_DIRECTORY}"/darwin/Resources/*.html
+ sed -i '' -e 's/__PRODUCT__/'${PRODUCT}'/g' "${TARGET_DIRECTORY}"/darwin/Resources/*.html
+ chmod -R 755 "${TARGET_DIRECTORY}/darwin/Resources/"
+
+ rm -rf "${TARGET_DIRECTORY}/darwinpkg"
+ mkdir -p "${TARGET_DIRECTORY}/darwinpkg"
+
+ mkdir -p "${TARGET_DIRECTORY}"/darwinpkg/Applications
+ cp -a "${APP_DIRECTORY}" "${TARGET_DIRECTORY}"/darwinpkg/Applications
+
+ rm -rf "${TARGET_DIRECTORY}/package"
+ mkdir -p "${TARGET_DIRECTORY}/package"
+ chmod -R 755 "${TARGET_DIRECTORY}/package"
+
+ rm -rf "${TARGET_DIRECTORY}/pkg"
+ mkdir -p "${TARGET_DIRECTORY}/pkg"
+ chmod -R 755 "${TARGET_DIRECTORY}/pkg"
+}
+
+# Creates the target/package folder. This includes a basic.pkg file with no formatting
+function buildPackage() {
+ log_info "Application installer package building started.(1/3)"
+ # For now I removed the --identifier
+ pkgbuild --version "${VERSION}" \
+ --scripts "${TARGET_DIRECTORY}/darwin/scripts" \
+ --root "${TARGET_DIRECTORY}/darwinpkg" \
+ --identifier "OpenBB Terminal" \
+ --ownership preserve \
+ "${TARGET_DIRECTORY}/package/${PRODUCT}.pkg"
+}
+
+# Creates the target/pkg folder. This includes the finished pkg file to let users download
+function buildProduct() {
+ log_info "Application installer product building started.(2/3)"
+ productbuild --distribution "${TARGET_DIRECTORY}/darwin/Distribution" \
+ --resources "${TARGET_DIRECTORY}/darwin/Resources" \
+ --package-path "${TARGET_DIRECTORY}/package" \
+ --sign "${APPLE_DEVELOPER_CERTIFICATE_ID}" \
+ "${TARGET_DIRECTORY}/pkg/$1"
+}
+
+function createInstaller() {
+ log_info "Application installer generation process started.(3 Steps)"
+ buildPackage
+ chmod -R 754 "${TARGET_DIRECTORY}/darwinpkg"
+ buildProduct OpenBBTerminalM1.pkg
+ log_info "Application installer generation steps finished."
+}
+
+#Main script
+log_info "Installer generating process started."
+
+copyDarwinDirectory
+copyBuildDirectory
+signFiles
+chmod 755 build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/.env
+# chmod -R 755 build/pyinstaller/macOS/target/darwinpkg/Applications/OpenBB\ Terminal/.OpenBB/
+createInstaller
+
+log_info "Installer generating process finished"
+exit 0
diff --git a/build/pyinstaller/macOS/darwin/Distribution b/build/pyinstaller/macOS/darwin/Distribution
new file mode 100644
index 00000000000..9e328d8662c
--- /dev/null
+++ b/build/pyinstaller/macOS/darwin/Distribution
@@ -0,0 +1,36 @@
+
+
Thank you for installing WSO2 API MAnager.
+Open a new terminal and run the following command to get start with APIM server:
+ $ wso2am-2.6.0 [command]
+ Go through following links for additional information.
+ +Run the following command to uninstall WSO2 API Manager.
+
+
$ sudo bash /Library/__PRODUCT__/__VERSION__/uninstall.sh
Copyright © 2019 WSO2 Inc. All rights reserved. API Manager and its use subject to a license agreement and are also subject to copyright, trademark patent and/or other laws.
+OpenBB is a leading open source investment research software platform for accessing and analyzing financial market data. We represent millions of investors who want to leverage state-of-the-art data science and machine learning technologies to make sense of raw unrefined data. Our mission is to make investment research effective, powerful and accessible to everyone.
+This installation procedure will install the OpenBB Terminal.
+ +