Skip to content

Commit

Permalink
automatic releases
Browse files Browse the repository at this point in the history
  • Loading branch information
dickreuter committed Jan 8, 2024
1 parent 1edc40c commit 1cabea8
Show file tree
Hide file tree
Showing 15 changed files with 635 additions and 384 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Binary Release

on:
workflow_dispatch:

jobs:
build:
runs-on: windows-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
show-progress: false

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.11
cache: pip

- name: Install Tesseract
run: |
iwr https://github.com/simonflueckiger/tesserocr-windows_build/releases/download/tesserocr-v2.6.0-tesseract-5.3.1/tesserocr-2.6.0-cp311-cp311-win_amd64.whl -Out tesserocr-2.6.0-cp311-cp311-win_amd64.whl
pip install tesserocr-2.6.0-cp311-cp311-win_amd64.whl
- name: Install dependencies
run: pip install -r requirements.txt

- name: Run PyInstaller
run: |
cd poker
pyinstaller main.spec
# Add other necessary steps here
- name: Prepare distribution
run: |
cd poker
mkdir dist\main\log
mkdir dist\main\pics
mkdir dist\main\log\screenshots
xcopy poker\icon.ico dist\main\poker.ico* /Y
xcopy poker\config_default.ini dist\main\config.ini* /Y
xcopy poker\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: 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:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./DeepMindPokerbot_winstaller.exe
asset_name: DeepMindPokerbot_winstaller.exe
asset_content_type: application/octet-stream
36 changes: 36 additions & 0 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
@@ -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
58 changes: 0 additions & 58 deletions .github/workflows/windows-build.yml

This file was deleted.

7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ cython_debug/
best_strategies.js
package.bat
*.exe
*.nsi
pokwerbot_downloader_initia.py
desktop.ini
pokerbot_downloader_initial.py
Expand Down Expand Up @@ -229,4 +228,8 @@ Poker.code-workspace
*.png*.dmg
*.autosave
*.code-workspace
*.png
*.png
*.ini
*.sh
*.spec
*.ipynb
38 changes: 0 additions & 38 deletions main.spec

This file was deleted.

148 changes: 148 additions & 0 deletions poker/DeepMindPokerbot.nsi
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1cabea8

Please sign in to comment.