diff --git a/.github/workflows/windows-build.yml b/.github/workflows/release.yml similarity index 51% rename from .github/workflows/windows-build.yml rename to .github/workflows/release.yml index 90f42f04..31e8eda5 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/release.yml @@ -1,9 +1,8 @@ -name: Windows Build +name: Binary Release on: - push: - branches: master - + workflow_dispatch: + jobs: build: runs-on: windows-latest @@ -36,23 +35,44 @@ jobs: - name: Prepare distribution run: | + cd poker mkdir dist\main\log mkdir dist\main\pics mkdir dist\main\log\screenshots - mkdir dist\main\decisionmaker - copy icon.ico dist\main - copy config_default.ini dist\main\config.ini + xcopy icon.ico dist\main\poker.ico* /Y + xcopy config_default.ini dist\main\config.ini* /Y xcopy vboxapi dist\main\vboxapi\ /E + - name: Show content + run: | + cd poker + dir dist\main + - name: Install NSIS run: | choco install nsis - name: Run NSIS - run: makensis -V3 DeepMindPokerbot.nsi - - - name: Upload Artifacts - uses: actions/upload-artifact@v2 + run: | + makensis -V3 DeepMindPokerbot.nsi + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: DeepermindPokerbot-${{ github.run_number }} + release_name: Release ${{ github.run_number }} + draft: false + prerelease: false + + - name: Upload Executable to Release + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - name: compiled-app - path: DeepMindPokerbot_winstaller.exe + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./DeepMindPokerbot_winstaller.exe + asset_name: DeepMindPokerbot_winstaller.exe + asset_content_type: application/octet-stream diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml new file mode 100644 index 00000000..483d9ad8 --- /dev/null +++ b/.github/workflows/website.yml @@ -0,0 +1,36 @@ +name: Update Website + +on: + push: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Use Node.js + uses: actions/setup-node@v1 + with: + node-version: '14' + + - name: Install Dependencies + run: npm install + working-directory: ./website + + - name: Build + run: npm run build + working-directory: ./website + + - name: Deploy to Server + run: | + mkdir -p ~/.ssh + echo "${{ secrets.DEPLOYMENT_KEY }}" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + ssh-keyscan dickreuter.com >> ~/.ssh/known_hosts + scp -i ~/.ssh/id_rsa -r ./dist/* ec2-user@dickreuter.com:/home/ec2-user/www/deepermind-pokerbot.com + env: + DEPLOY_KEY: ${{ secrets.DEPLOYMENT_KEY }} + working-directory: ./website diff --git a/.gitignore b/.gitignore index 481e4c36..c7f62dd3 100644 --- a/.gitignore +++ b/.gitignore @@ -166,7 +166,6 @@ cython_debug/ best_strategies.js package.bat *.exe -*.nsi pokwerbot_downloader_initia.py desktop.ini pokerbot_downloader_initial.py @@ -229,4 +228,8 @@ Poker.code-workspace *.png*.dmg *.autosave *.code-workspace -*.png \ No newline at end of file +*.png +*.ini +*.sh +*.spec +*.ipynb \ No newline at end of file diff --git a/main.spec b/main.spec deleted file mode 100644 index 6cdd58f0..00000000 --- a/main.spec +++ /dev/null @@ -1,38 +0,0 @@ -# -*- mode: python ; coding: utf-8 -*- - -block_cipher = None - - -a = Analysis(['main.py'], - pathex=['poker'], - datas=[ ( 'gui/ui/*.ui', '.' ),( 'gui/ui/*.ui', 'gui/ui' ),( 'decisionmaker/*.json', 'decisionmaker' )], - binaries=[], - hiddenimports=['pkg_resources.py2_warn', 'fastapi'], - hookspath=[], - runtime_hooks=[], - excludes=[], - win_no_prefer_redirects=False, - win_private_assemblies=False, - cipher=block_cipher, - noarchive=False) -pyz = PYZ(a.pure, a.zipped_data, - cipher=block_cipher) -exe = EXE(pyz, - a.scripts, - [], - exclude_binaries=True, - name='main', - debug=False, - bootloader_ignore_signals=False, - strip=False, - upx=True, - console=True, - icon='icon.ico') -coll = COLLECT(exe, - a.binaries, - a.zipfiles, - a.datas, - strip=False, - upx=True, - upx_exclude=[], - name='main') diff --git a/poker/DeepMindPokerbot.nsi b/poker/DeepMindPokerbot.nsi new file mode 100755 index 00000000..5a3e7152 --- /dev/null +++ b/poker/DeepMindPokerbot.nsi @@ -0,0 +1,148 @@ +;NSIS Modern User Interface +;Basic Example Script + +;-------------------------------- +;Include Modern UI + + !include "MUI2.nsh" + !define MUI_PRODUCT "DeepMind Pokerbot" + !define MUI_FILE "main" + !define MUI_VERSION "" + !define MUI_BRANDINGTEXT "DeepMind Pokerbot" + !define MUI_ICON "icon.ico" + !define MUI_UNICON "icon.ico" + CRCCheck On + + ;-------------------------------- +;Language + !insertmacro MUI_LANGUAGE "English" + !include LogicLib.nsh + +;-------------------------------- + + +;Folder selection page + + InstallDir "$APPDATA\${MUI_PRODUCT}" + + +;-------------------------------- +;Modern UI Configuration + +Page components +Page directory +Page instfiles +UninstPage uninstConfirm +UninstPage instfiles + + + + + +;-------------------------------- +;General + + ;Name and file + Name "DeepMindPokerbot" + OutFile "..\DeepMindPokerbot_winstaller.exe" + + + + + ;Get installation folder from registry if available + InstallDirRegKey HKCU "Software\DeepMindPokerbot" "" + + ;Request application privileges for Windows Vista + RequestExecutionLevel admin ;Require admin rights on NT6+ (When UAC is turned on) + + +;-------------------------------- +;Installer Sections + +Section "DeepMind Pokerbot" +SectionIn RO + + SetOutPath "$INSTDIR\tessdata" + File /r "..\tessdata\*" + SetOutPath "$INSTDIR" + File /r "dist\main\*" + + + ;Store installation folder + WriteRegStr HKCU "Software\DeepMindPokerbot" "" $INSTDIR + + ;create desktop shortcut + CreateShortCut "$DESKTOP\${MUI_PRODUCT}.lnk" "$INSTDIR\${MUI_FILE}" "" "$INSTDIR\icon.ico" + + ;create start-menu items + CreateDirectory "$SMPROGRAMS\${MUI_PRODUCT}" + CreateShortCut "$SMPROGRAMS\${MUI_PRODUCT}\Uninstall.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0 + CreateShortCut "$SMPROGRAMS\${MUI_PRODUCT}\${MUI_PRODUCT}.lnk" "$INSTDIR\${MUI_FILE}.exe" "$INSTDIR\icon.ico" "$INSTDIR\${MUI_FILE}.exe" 0 + + ;write uninstall information to the registry + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "DisplayName" "${MUI_PRODUCT} (remove only)" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" "UninstallString" "$INSTDIR\Uninstall.exe" + + ;Create uninstaller + WriteUninstaller "$INSTDIR\Uninstall.exe" + + Call LaunchLink +SectionEnd + + +;-------------------------------- + +;Uninstaller Section +Section "Uninstall" + +;Delete Files + RMDir /r "$INSTDIR\*.*" + +;Remove the installation directory + RMDir "$INSTDIR" + +;Delete Start Menu Shortcuts + Delete "$DESKTOP\${MUI_PRODUCT}.lnk" + Delete "$SMPROGRAMS\${MUI_PRODUCT}\*.*" + RmDir "$SMPROGRAMS\${MUI_PRODUCT}" + + ;Delete Desktop Shortcuts + Delete "$DESKTOP\${MUI_PRODUCT}.lnk" + +;Delete Uninstaller And Unistall Registry Entries + DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\${MUI_PRODUCT}" + DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${MUI_PRODUCT}" + +SectionEnd + + +;-------------------------------- +;MessageBox Section + + + + +Function un.onUninstSuccess + MessageBox MB_OK "You have successfully uninstalled ${MUI_PRODUCT}." +FunctionEnd + + Function LaunchLink + MessageBox MB_YESNO "Start the Pokerbot now?" IDYES true IDNO false + true: + ExecShell "" "$DESKTOP\${MUI_PRODUCT}.lnk" + false: + +FunctionEnd + + +Function .onInit +UserInfo::GetAccountType +pop $0 +${If} $0 != "admin" ;Require admin rights on NT4+ + MessageBox mb_iconstop "Administrator rights required!" + SetErrorLevel 740 ;ERROR_ELEVATION_REQUIRED + Quit +${EndIf} +FunctionEnd + +;eof \ No newline at end of file diff --git a/poker/main.spec b/poker/main.spec index 39014552..6cdd58f0 100644 --- a/poker/main.spec +++ b/poker/main.spec @@ -1,50 +1,38 @@ # -*- mode: python ; coding: utf-8 -*- - block_cipher = None -a = Analysis( - ['main.py'], - pathex=[], - binaries=[], - datas=[], - hiddenimports=[], - hookspath=[], - hooksconfig={}, - runtime_hooks=[], - excludes=[], - win_no_prefer_redirects=False, - win_private_assemblies=False, - cipher=block_cipher, - noarchive=False, -) -pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) - -exe = EXE( - pyz, - a.scripts, - [], - exclude_binaries=True, - name='main', - debug=False, - bootloader_ignore_signals=False, - strip=False, - upx=True, - console=True, - disable_windowed_traceback=False, - argv_emulation=False, - target_arch=None, - codesign_identity=None, - entitlements_file=None, -) -coll = COLLECT( - exe, - a.binaries, - a.zipfiles, - a.datas, - strip=False, - upx=True, - upx_exclude=[], - name='main', -) +a = Analysis(['main.py'], + pathex=['poker'], + datas=[ ( 'gui/ui/*.ui', '.' ),( 'gui/ui/*.ui', 'gui/ui' ),( 'decisionmaker/*.json', 'decisionmaker' )], + binaries=[], + hiddenimports=['pkg_resources.py2_warn', 'fastapi'], + hookspath=[], + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False) +pyz = PYZ(a.pure, a.zipped_data, + cipher=block_cipher) +exe = EXE(pyz, + a.scripts, + [], + exclude_binaries=True, + name='main', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + console=True, + icon='icon.ico') +coll = COLLECT(exe, + a.binaries, + a.zipfiles, + a.datas, + strip=False, + upx=True, + upx_exclude=[], + name='main') diff --git a/requirements.txt b/requirements.txt index 9e577dde..86cd8f05 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,31 +1,31 @@ -pandas -pytest +pandas==2.0.3 +pytest==7.3.1 pylint pydocstyle -numpy -matplotlib +numpy==1.23.5 +matplotlib==3.7.2 scipy -opencv-python +opencv-python==4.8.0.76 pillow -pyinstaller -pymongo +pyinstaller==5.13.0 +pymongo==4.3.3 pyqt6 -pytesseract +pytesseract==0.3.10 virtualbox pyyaml requests jupyter xlib xlrd -lmfit -openpyxl -numexpr -fastapi -tensorflow +lmfit==1.2.0 +openpyxl==3.1.2 +numexpr==2.8.4 +fastapi==0.101.1 +tensorflow==2.12.0 tqdm -seaborn +seaborn==0.12.2 PyJWT==1.7.0 flask_jwt_extended fastapi_auth -uvicorn +uvicorn==0.23.2 tesserocr diff --git a/website/package.json b/website/package.json index b332f817..a7ae36dc 100644 --- a/website/package.json +++ b/website/package.json @@ -5,8 +5,8 @@ "type": "module", "scripts": { "dev": "vite", - "build": "tsc && vite build", - "build2": "vite build", + "build_strict": "tsc && vite build", + "build": "vite build", "forcebuild": "vite build", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview" diff --git a/website/src/routes/NavBar.tsx b/website/src/routes/NavBar.tsx index 93c34c50..2edcf580 100644 --- a/website/src/routes/NavBar.tsx +++ b/website/src/routes/NavBar.tsx @@ -1,45 +1,77 @@ -import 'bootstrap/dist/css/bootstrap.css'; +import "bootstrap/dist/css/bootstrap.css"; import { Link } from "react-router-dom"; +import { useDlLink } from "../views/config"; function NavBar() { - return ( - - ) +
+ + ); } -export default NavBar \ No newline at end of file +export default NavBar; diff --git a/website/src/views/Purchase.tsx b/website/src/views/Purchase.tsx index ee779f87..1806d10d 100644 --- a/website/src/views/Purchase.tsx +++ b/website/src/views/Purchase.tsx @@ -1,194 +1,233 @@ -import Button from '@mui/material/Button'; -import ClickAwayListener from '@mui/material/ClickAwayListener'; -import Tooltip from '@mui/material/Tooltip'; -import 'bootstrap/dist/css/bootstrap.css'; -import { useState } from 'react'; +import Button from "@mui/material/Button"; +import ClickAwayListener from "@mui/material/ClickAwayListener"; +import Tooltip from "@mui/material/Tooltip"; +import axios from "axios"; +import "bootstrap/dist/css/bootstrap.css"; +import { useState } from "react"; +import { useDlLink } from './config'; function PaymentCards() { - const [hover, setHover] = useState(false); - const [showBitcoin, setShowBitcoin] = useState(false); - const bitcoinAddress = "bc1q6r0l549jefv3rgs7e0jzsdkx9pq9trd2cqyw50" - const dl_link = "https://onedrive.live.com/download?cid=A3B69BDCC03E82A9&resid=A3B69BDCC03E82A9%21111289&authkey=AEftpEpz8jxnBdI" + const [hover, setHover] = useState(false); + const [showBitcoin, setShowBitcoin] = useState(false); + const bitcoinAddress = "bc1q6r0l549jefv3rgs7e0jzsdkx9pq9trd2cqyw50"; + const dlLink = useDlLink(); + const goToLink = (link: string) => { + window.location.href = link; + }; + const handleCopy = () => { + if (!showBitcoin) setShowBitcoin(true); + else setShowBitcoin(false); + }; - const goToLink = (link: string) => { - window.location.href = link; - } - const handleCopy = () => { - if (!showBitcoin) setShowBitcoin(true); - else setShowBitcoin(false); - }; - - return ( - <>