Skip to content

Commit

Permalink
Merge pull request #15 from Zhou-Shilin/main
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Add support for Windows/Linux executable edition
  • Loading branch information
Zhou-Shilin authored May 29, 2024
2 parents 1f7e1f3 + 748138b commit d12903b
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 7 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
@@ -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@v4
with:
name: linux-build
path: linux-build.zip
41 changes: 41 additions & 0 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
@@ -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
Compress-Archive -Path . -DestinationPath ../windows-build.zip
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: windows-build
path: windows-build.zip
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/<name>.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/<name>.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.
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
openai>=1.13.3
pyyaml
tkinter
cx_Freeze
playwright
uuid
uuid
31 changes: 31 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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="[email protected]",
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,
}
})

0 comments on commit d12903b

Please sign in to comment.