From 007f847b83f9f3ed1165c3287479b0b748a6a8f8 Mon Sep 17 00:00:00 2001 From: BaimoQilin Date: Wed, 29 May 2024 18:05:48 +0800 Subject: [PATCH 1/4] feat: Add windows/linux executable edition --- .github/workflows/build-linux.yml | 41 +++++++++++++++++++++++++++++ .github/workflows/build-windows.yml | 41 +++++++++++++++++++++++++++++ README.md | 27 +++++++++++++++---- setup.py | 31 ++++++++++++++++++++++ 4 files changed, 135 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/build-linux.yml create mode 100644 .github/workflows/build-windows.yml create mode 100644 setup.py diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml new file mode 100644 index 0000000..9c225bb --- /dev/null +++ b/.github/workflows/build-linux.yml @@ -0,0 +1,41 @@ +name: Linux Builds + +on: + push: + branches: + - main + release: + types: + - created + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.x + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Build project + run: python setup.py build + + - name: Zip build folder + run: | + cd build + zip -r ../linux-build.zip . + + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: linux-build + path: linux-build.zip \ No newline at end of file diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml new file mode 100644 index 0000000..285ebc8 --- /dev/null +++ b/.github/workflows/build-windows.yml @@ -0,0 +1,41 @@ +name: Windows Builds + +on: + push: + branches: + - main + release: + types: + - created + +jobs: + build: + runs-on: windows-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.x + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Build project + run: python setup.py build + + - name: Zip build folder + run: | + cd build + zip -r ../windows-build.zip . + + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: windows-build + path: windows-build.zip diff --git a/README.md b/README.md index 25cd757..fd71d70 100644 --- a/README.md +++ b/README.md @@ -87,25 +87,42 @@ After the user enters a requirement, the program uses `gpt-4-preview` to expand The program then parses this `json` response. Then it uploads the image (headless) to cubical.xyz and downloads the rendered image from the site using `playwright`. ## Requirements + +### Plan A. Windows/Linux (executable edition) + +> [!WARNING] +> The version of the executable is still in the testing process. Plan B is recommended if possible. + +Nothing. Just download the executable file and run it. + +### Plan B. Python (Any operating systems; Recommend if possible) + You can use BukkitGPT on any device with [Python 3+](https://www.python.org/). -And you need to install this package: +And you need to install the depencies with this command: ``` -pip install openai +pip install -r requirements.txt ``` ## Quick Start *(Make sure you have the [Python](https://www.python.org) environment installed on your computer)* -### UI (HIGHLY RECOMMEND) -1. Download `Source Code.zip` from [the release page]([https:///](https://github.com/CubeGPT/BuilderGPT/releases)) and unzip it. +### Executable/UI +1. Download `windows-build.zip` or `linux-build.zip` from [the release page](https://https://github.com/CubeGPT/BuilderGPT/releases) and unzip it. +2. Edit `config.yaml`, fill in your OpenAI Apikey. If you don't know how, remember that [Google](https://www.google.com/) and [Bing](https://www.bing.com/) are always your best friends. +3. Run `ui.exe`, enter the description and let GPT generate the structure. +4. Find your structure in `/generated/.schem`. +5. Import the file into the game via worldedit or other tools. (Google is your best friend~~) + +### Python/UI (RECOMMEND) +1. Download `Source Code.zip` from [the release page](https://https://github.com/CubeGPT/BuilderGPT/releases) and unzip it. 2. Edit `config.yaml`, fill in your OpenAI Apikey. If you don't know how, remember that [Google](https://www.google.com/) and [Bing](https://www.bing.com/) are always your best friends. 3. Run `ui.py` (bash `python ui.py`), enter the description and let GPT generate the structure. 4. Find your structure in `/generated/.schem`. 5. Import the file into the game via worldedit or other tools. (Google is your best friend~~) -### Console +### Python/Console 1. Download `Source Code.zip` from [the release page]([https:///](https://github.com/CubeGPT/BuilderGPT/releases)) and unzip it. 2. Edit `config.yaml`, fill in your OpenAI Apikey. If you don't know how, remember that [Google](https://www.google.com/) and [Bing](https://www.bing.com/) are always your best friends. 3. Run `console.py` (bash `python console.py`), enter the description and let GPT generate the structure. diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..e6aad42 --- /dev/null +++ b/setup.py @@ -0,0 +1,31 @@ +from cx_Freeze import setup, Executable + +import config + +files = [ + "browser.py", + "config.py", + "config.yaml", + "console.py", + "core.py", + "LICENSE", + "log_writer.py", + "logo.png", + "README.md", + "requirements.txt", + "ui.py" +] + +setup(name='BuilderGPT', + version=config.VERSION_NUMBER, + maintainer="CubeGPT Team", + maintainer_email="admin@cubegpt.org", + url="https://github.com/CubeGPT/BuilderGPT", + license="Apache License 2.0", + description='An open source, free, AI-powered Minecraft structure generator developed by CubeGPT.', + executables=[Executable('ui.py', base="gui")], + options={ + "build_exe": { + "include_files": files, + } + }) \ No newline at end of file From e76dee288e37227394abf9e5fb22646a191186a5 Mon Sep 17 00:00:00 2001 From: BaimoQilin Date: Wed, 29 May 2024 18:09:01 +0800 Subject: [PATCH 2/4] fix: Could not find a version that satisfies the requirement tkinter --- requirements.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 0c83f3f..7b65969 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,5 @@ openai>=1.13.3 pyyaml -tkinter cx_Freeze playwright -uuid +uuid \ No newline at end of file From 7cdb20e115d3416a754b05f5cb43ee88a5ca9b14 Mon Sep 17 00:00:00 2001 From: BaimoQilin Date: Wed, 29 May 2024 18:12:08 +0800 Subject: [PATCH 3/4] fix: Command not found on Windows platform --- .github/workflows/build-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 285ebc8..ad07061 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -32,7 +32,7 @@ jobs: - name: Zip build folder run: | cd build - zip -r ../windows-build.zip . + Compress-Archive -Path . -DestinationPath ../windows-build.zip - name: Upload artifact uses: actions/upload-artifact@v2 From 748138b703e445f1b729caed99d505ce904c8d4f Mon Sep 17 00:00:00 2001 From: BaimoQilin Date: Wed, 29 May 2024 18:16:08 +0800 Subject: [PATCH 4/4] fix: upload-artifact@v2 is not longer supported, use v4 instead --- .github/workflows/build-linux.yml | 2 +- .github/workflows/build-windows.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 9c225bb..4fecdaa 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -35,7 +35,7 @@ jobs: zip -r ../linux-build.zip . - name: Upload artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: linux-build path: linux-build.zip \ No newline at end of file diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index ad07061..1bcb7f7 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -35,7 +35,7 @@ jobs: Compress-Archive -Path . -DestinationPath ../windows-build.zip - name: Upload artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: windows-build path: windows-build.zip