diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..a99950d --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @KTrain5169 \ No newline at end of file diff --git a/.github/workflows/mkdocs-build.yml b/.github/workflows/mkdocs-build.yml new file mode 100644 index 0000000..c15eded --- /dev/null +++ b/.github/workflows/mkdocs-build.yml @@ -0,0 +1,37 @@ +name: Build docs site + +on: + push: + paths: + - "docs/**" + - "mkdocs.yml" + pull_request: + paths: + - "docs/**" + - "mkdocs.yml" + workflow_dispatch: + +jobs: + build-docs: + name: Build docs + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: 3.11 + + - name: Install dependencies + run: pip install -r requirements.txt + + - name: MkDocs + run: mkdocs build + + - name: Upload build + uses: actions/upload-artifact@v4 + with: + name: Completed mkdocs build - ${{ github.sha }} + path: site/ \ No newline at end of file diff --git a/.github/workflows/mkdocs-deploy.yml b/.github/workflows/mkdocs-deploy.yml new file mode 100644 index 0000000..67a06c2 --- /dev/null +++ b/.github/workflows/mkdocs-deploy.yml @@ -0,0 +1,23 @@ +name: Deploy docs site + +on: + workflow_dispatch: + +jobs: + build-docs: + name: Build docs + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: 3.11 + + - name: Install dependencies + run: pip install -r requirements.txt + + - name: MkDocs + run: mkdocs gh-deploy \ No newline at end of file diff --git a/.github/workflows/script-build.yml b/.github/workflows/script-build.yml new file mode 100644 index 0000000..6a8824b --- /dev/null +++ b/.github/workflows/script-build.yml @@ -0,0 +1,47 @@ +name: Build Python app + +on: + push: + paths: + - 'script.py' + pull_request: + paths: + - 'script.py' + workflow_dispatch: + +jobs: + build: + name: Build app on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: ["windows-latest", "macos-latest", "ubuntu-latest"] + steps: + - name: Checkout ref + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: 3.11 + + - name: Install requirements + run: | + pip install -r requirements.txt + + - name: PyInstaller + run: pyinstaller script.py --name CatPack_Crafter_${{ github.sha }}_${{ matrix.os }} + + - name: Upload Builds + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.os }} build + path: build/ + + - name: Upload Dists + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.os }} dist + path: dist/ diff --git a/.github/workflows/script-release.yml b/.github/workflows/script-release.yml new file mode 100644 index 0000000..59ae4c5 --- /dev/null +++ b/.github/workflows/script-release.yml @@ -0,0 +1,88 @@ +name: Release Python app + +run-name: Release ${{ github.ref_name }} + +on: + push: + tags: + - "v*" + +permissions: + contents: write + +jobs: + build: + name: Build app for ${{ matrix.os }} + runs-on: ${{ matrix.runner_os }} + strategy: + matrix: + runner_os: ["windows-latest", "macos-latest", "ubuntu-latest"] + includes: + - runner_os: "windows-latest" + os: "Windows" + - runner_os: "macos-latest" + os: "Mac" + - runner_os: "ubuntu-latest" + os: "Linux" + steps: + - name: Checkout ref + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: 3.11 + + - name: Install requirements + run: | + pip install -r requirements.txt + + - name: PyInstaller + run: pyinstaller --onefile --windowed script.py --name CatPack_Crafter_${{ github.ref_name }}_${{ matrix.os }} + + - name: List dist directory + run: ls -R dist + + - name: Tar files on Linux + if: ${{ matrix.runner_os == 'ubuntu-latest' }} + run: | + chmod +x dist/CatPack_Crafter_${{ github.ref_name }}_${{ matrix.os }} + tar -czvf dist/CatPack_Crafter_${{ github.ref_name }}_${{ matrix.os }}.tar.gz dist/CatPack_Crafter_${{ github.ref_name }}_${{ matrix.os }} + rm -rf dist/CatPack_Crafter_${{ github.ref_name }}_${{ matrix.os }} + + - name: Upload debug builds + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.os }}_builds + path: build/* + + - name: Upload distributable builds + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.os }}_dists + path: dist/* + + normal_release: + name: Draft normal release + runs-on: ubuntu-latest + needs: build + steps: + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + path: release-artifacts + pattern: "*_dists" + + - name: List release-artifacts directory # debug + run: ls -R release-artifacts + + - name: Draft normal release + uses: ncipollo/release-action@v1.14.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + generateReleaseNotes: true + tag: ${{ github.ref_name }} + artifacts: + draft: true + name: "CatPack_Crafter_${{ github.ref_name }}_*" + body: "Need help? Refer to the documentation site." diff --git a/docs/contributing.md b/docs/contributing.md new file mode 100644 index 0000000..2026983 --- /dev/null +++ b/docs/contributing.md @@ -0,0 +1,17 @@ +# Contributing + +Want to help? Great! To get started, follow these steps. This guide assumes you know how to use Git on a basic level. + +- [Fork this repository](https://github.com/KTrain5169/CatPackMaker/fork) and clone your fork. +- Create a virtual environment using `python -m venv venv`, then run `venv\scripts\activate` to activate it. +- Install all dependencies using `pip install -r requirements.txt`. +- Make your changes, then test your changes to see if they will work. +- Commit your changes and push it, then create a Pull Request. +- Your PR will be reviewed and will either have changes requested or approved and merged. + +We recommend the following when contributing: + +- Using VS Code (or a fork of it)? You should see recommendations regarding extensions to use. We recommend installing them. +- We also recommend installing `autopep8` via `pip install autopep8` to ensure you follow styling. +- Before committing your changes and pushing them it may be a good idea to build and then test them. This isn't strictly necessary, but can be helpful. +- Be helpful in your commit names. diff --git a/docs/downloads.md b/docs/downloads.md new file mode 100644 index 0000000..4bdc43a --- /dev/null +++ b/docs/downloads.md @@ -0,0 +1,15 @@ +# Downloads + +The following page lists releases of this software. + +- [Latest release on GitHub](https://github.com/KTrain5169/CatPackMaker/releases/latest) +- [⚠️Unstable builds on GitHub⚠️](https://github.com/KTrain5169/CatPackMaker/actions) - please be aware that this is beta software and stuff can break if you are using these versions. You will receive limited support if you are using these builds. +- [Running the script from source](./run-from-source.md) - same as above in that this is considered "beta" software. + +???+ note "Historical versions" + + This is here for archival purposes. When new versions are released, it may take a little bit before this table is updated. + + | Version | Changelog link | Direct download link | + |---------|----------------|----------------------| + | v1.0.0 | TBA | TBA | diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..840b29c --- /dev/null +++ b/docs/index.md @@ -0,0 +1,12 @@ +# Advanced CatPack crafter + +This program simplifies creating an advanced Prism Launcher CatPack. + +This site hosts documentation on how to use this program. You can navigate using the sidebar. + +Other useful links: + +- [Prism Launcher Community CatPacks (Discord)](https://discord.com/channels/1031648380885147709/1278732669525561486) +- [Issue tracker](https://github.com/KTrain5169/CatPackMaker/issues) +- [Discord server](https://discord.gg/G6YvWhctjk) (Ask for support in there!) +- [Pull requests](https://github.com/KTrain5169/CatPackMaker/pulls) diff --git a/docs/instructions.md b/docs/instructions.md new file mode 100644 index 0000000..d2d9904 --- /dev/null +++ b/docs/instructions.md @@ -0,0 +1,37 @@ +# How to use + +Using the app should be fairly simple, so hopefully this will be a walk in the park. + +## 1. Locate your images + +It's a good idea to consolidate the images you will be using in a singular folder, or *at least* remember the path to get to them. Otherwise, you'll have take very long time trying to find the images you want. + +## 2. Using the app + +Assuming you have already [downloaded the program](./downloads.md), run it and you'll be presented with a couple of options. + +- `CatPack Name`: THe name of the CatPack, both in the JSON and the folder name. Be careful - if a folder with that name already exists and has a CatPack setup in it, the new JSON file will overwrite it. +- `Select Output Folder`: Where the CatPack's folder will be located in. +- `Select Default Image (Optional)`: Allows you to select an image that will be set as a "default", which means it wll show if no other image can be shown. The default image will be previewed at a smaller size beneath the options. +- `Add Images`: Adds images to your CatPack. Each image will ask you for a Start and End date/month. Be cautious: the program does not have sanity checks for the calendar dates, so be sure not to accidentally input the 31st of Febuary (or something of that vein)! +- `Confirm`: Creates the CatPack using the above options. + +## Using the CatPack + +Once your CatPack is created, you can move the folder with all the CatPack stuff into your Prism installation's `catpacks` folder. +This should be located at `../PrismLauncher/catpacks`, where `..` varies depending on the form of Prism you are using: + +???+ note "What would .. mean in my case?" + + If you are using a portable build of Prism, .. represents the directory where your portable build resides. + + If you are using a fully installed build of Prism, .. is represented differently depending on OS: + + - Windows: `%appdata%` + - macOS: `~/Library/Application Support` + - Linux: `~/.local/share` + + However, if you use either of the following package managers, they will instead be located at: + + - Scoop: `%HOMEPATH%/scoop/persist` - Note that the directory may be seen as `prismlauncher` instead of `PrismLauncher`. This is as intended. + - Flatpak: `~/.var/app/org.prismlauncher.PrismLauncher/data` diff --git a/docs/run-from-source.md b/docs/run-from-source.md new file mode 100644 index 0000000..a77a591 --- /dev/null +++ b/docs/run-from-source.md @@ -0,0 +1,31 @@ +# Run from source + +This page details how to run the program from source. If you have no idea what this page is saying, you *probably* shouldn't follow it. + +## Setup + +In order to build, you'll need the following as prerequisites: + +- A working Python installation that supports the code. The version used for developing this program originally was Python 3.11 from the [official Python website](https://python.org). +- Required dependencies installed. They are marked in the `requirements.txt` file for your convenience. +- While not required, it is *highly recommended* to use a virtual environment. You can create one using `python -m venv venv`, then using `venv\scripts\activate`. + +## Running the app + +Once you have the "App" category of dependencies installed, you can simply run `python script.py`. + +## Compiling from source + +After installing dependencies in both the "App" and "Compiling" categories, you can run `pyinstaller script.py` to compile. +Some additional arguments you might want to use are: + +- `--onefile`: Builds into a singular executable file. +- `--name `: Sets the executable output's name. +- `--windowed`: Prevents CMD from coming up when you launch the executable. + +## Building the documentation site + +You only need to install the dependencies listed in the "Documentation" category. +After that, you can simply run `mkdocs build`, which will output a `site/` folder that contains the fully built site. + +Do NOT attempt to run `mkdocs gh-deploy`, as it will create a new branch and (attempt to) push it to the remote. diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..9316b91 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,13 @@ +site_name: CatPack Crafter docs +repo_name: GitHub source +repo_url: https://github.com/KTrain5169/CatPackMaker +edit_uri: blob/main/docs/ +site_description: Documentation for the CatPack Crafter. +site_author: KTrain5369 +theme: + name: material +nav: + - Home: index.md + - Download: downloads.md + - How to use: instructions.md + - Contributing: contributing.md \ No newline at end of file