From 71747cbe5353e320964fd102fcc414227dc76629 Mon Sep 17 00:00:00 2001 From: Nicolas Dickreuter Date: Wed, 10 Jan 2024 22:32:30 +0000 Subject: [PATCH] add mac release --- .github/workflows/release mac.yml | 71 +++++++++++++++++++ .../{release.yml => release win.yml} | 10 +-- readme.rst | 1 + 3 files changed, 74 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/release mac.yml rename .github/workflows/{release.yml => release win.yml} (90%) diff --git a/.github/workflows/release mac.yml b/.github/workflows/release mac.yml new file mode 100644 index 00000000..da848443 --- /dev/null +++ b/.github/workflows/release mac.yml @@ -0,0 +1,71 @@ +name: Binary Release for MacOS + +on: + workflow_dispatch: + +jobs: + build: + runs-on: macos-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: 3.11 + cache: pip + + - name: Install dependencies + run: pip install -r requirements.txt + + - name: Run PyInstaller for MacOS + run: | + cd poker + pyinstaller --noconfirm --clean --distpath dist/main main.spec + + - name: Prepare distribution for MacOS + run: | + cd poker + mkdir -p dist/main/log + mkdir -p dist/main/pics + mkdir -p dist/main/log/screenshots + cp icon.ico dist/main/poker.ico + cp config_default.ini dist/main/config.ini + cp -r vboxapi dist/main/vboxapi/ + + - name: Install create-dmg + run: npm install -g create-dmg + + - name: List contents of PyInstaller output directory + run: | + cd poker/dist/main + ls + + - name: Create DMG + run: | + cd poker/dist/main + create-dmg DeepMindPokerbot.dmg . + + - name: Create Release for MacOS + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: DeepermindPokerbot-mac-${{ github.run_number }} + release_name: Mac Release ${{ github.run_number }} + draft: false + prerelease: false + + - name: Upload DMG 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: /Users/runner/work/Poker/Poker/dist/main/DeepMindPokerbot.dmg + asset_name: DeepMindPokerbot.dmg + asset_content_type: application/octet-stream + diff --git a/.github/workflows/release.yml b/.github/workflows/release win.yml similarity index 90% rename from .github/workflows/release.yml rename to .github/workflows/release win.yml index bb68c064..cb50bd6b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release win.yml @@ -1,4 +1,4 @@ -name: Binary Release +name: Binary Release Windows on: workflow_dispatch: @@ -31,7 +31,6 @@ jobs: run: | cd poker pyinstaller main.spec - # Add other necessary steps here - name: Prepare distribution run: | @@ -43,11 +42,6 @@ jobs: 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 @@ -63,7 +57,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: DeepermindPokerbot-${{ github.run_number }} - release_name: Release ${{ github.run_number }} + release_name: Windows Release ${{ github.run_number }} draft: false prerelease: false diff --git a/readme.rst b/readme.rst index 83be095b..c087f43f 100644 --- a/readme.rst +++ b/readme.rst @@ -184,6 +184,7 @@ Running via python source code ------------------------------ - Download pycharm communite edition as an IDE from here: https://www.jetbrains.com/pycharm/download/#section=windows - Install anaconda https://www.anaconda.com/products/distribution +- Download tesserocr: 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 and install the whleel file with pip install - Create an environment with ``pip install -r requirements.txt`` and separately run pip install tesserocr - You also may need to get c++ runtime distributable: https://visualstudio.microsoft.com/downloads/ - Install virtualbox from https://www.virtualbox.org/wiki/Downloads and put the poker client into the virtual box. That way it can be controlled without having to use the mouse in your main window.