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 e4ac9a6
Show file tree
Hide file tree
Showing 14 changed files with 591 additions and 339 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: Windows Build
name: Binary Release

on:
push:
branches: master

workflow_dispatch:

jobs:
build:
runs-on: windows-latest
Expand Down Expand Up @@ -36,23 +35,45 @@ 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 vboxapi dist\main\vboxapi\ /E
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: 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
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
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
78 changes: 33 additions & 45 deletions poker/main.spec
Original file line number Diff line number Diff line change
@@ -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')

0 comments on commit e4ac9a6

Please sign in to comment.