Skip to content
This repository has been archived by the owner on Jan 4, 2025. It is now read-only.

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
Signed-off-by: Kitki30 <[email protected]>
  • Loading branch information
Kitki30 committed Aug 18, 2024
0 parents commit 4b0aa87
Show file tree
Hide file tree
Showing 43 changed files with 3,843 additions and 0 deletions.
100 changes: 100 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Bug report
description: Report a bug.
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Report bugs here!
- type: dropdown
id: microcontroller-dropdows
attributes:
label: Microcontroller
description: |
Please select microcontroller you are using
options:
- "Raspberry Pi Pico W"
multiple: false
validations:
required: true
- type: input
id: gameberry-version
attributes:
label: GameBerry version
description: |
To check the version:
1. Turn on microcontroller
2. Version will be shown on boot
placeholder: |
v0.8
validations:
required: true

- type: input
id: micropython-version
attributes:
label: Micropython version
description: |
Please type the version of micropython that is installed on your microcontroller.
placeholder: |
MicroPython v1.23.0 on 2024-05-31; darwin [GCC 4.2.1] version
validations:
required: true

- type: textarea
id: steps-to-reproduce
attributes:
label: Steps to reproduce
description: |
Please enter steps to reproduce the bug.
If bug happens when you launch a game/plugin, please type Github Repo with code of Game/Plugin
placeholder: |
1. Turn on microcontroller
2. Press Home button 20 times.
validations:
required: true
- type: textarea
id: expected
attributes:
label: Expected behaviour
description: |
What should it do?
placeholder: |
Expected to launch easter egg.
- type: textarea
id: what-happened
attributes:
label: Observed behaviour / Error log
description: |
What happened? Provide error log if you can.
placeholder: |
My gameberry exploded 😮!
validations:
required: true
- type: checkboxes
id: additional-hardware
attributes:
label: Additional hardware used
description: You can select more than one.
options:
- label: Battery (Please provide type of battery, charger, capacity, and battery name in additional info)
- label: INA219 (Measures battery voltage, current and power)
- label: SD Card reader (Provide sd card capacity if sd card is used)
- type: textarea
id: additional-info
attributes:
label: Additioal information
description: |
Anything else? Type additional information here!
placeholder: |
I used 32GB FAT32 formatted SD card
validations:
required: false
- type: markdown
attributes:
value: |
Thanks for taking the time to help improve Gameberry.
179 changes: 179 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
name: Release bot

on:
push:
branches:
- main # Trigger on push to the main branch

jobs:
minify:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Python
uses: actions/[email protected]

- name: Install dependencies
run: |
pip install python-minifier
- name: Minify Python files
run: |
python -c "
import os
import python_minifier
def handle_folder(path):
for file in os.listdir(path):
full_path = os.path.join(path, file)
print('Scan:', file)
if os.path.isdir(full_path):
print('called with:', file)
handle_folder(full_path)
elif file.endswith('.py'):
print('Minify:', file)
with open(full_path, 'r') as f:
content = f.read()
minified_content = python_minifier.minify(content)
with open(full_path, 'w') as f:
f.write(minified_content)
scan_path = './pico_w/Gameberry/'
handle_folder(scan_path)
"
- name: Upload Minified Files
uses: actions/upload-artifact@v3
with:
name: minified-files-pico_w
path: ./pico_w/Gameberry/

json-to-python:
runs-on: ubuntu-latest
needs: minify
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download Minified Files
uses: actions/download-artifact@v3
with:
name: minified-files-pico_w
path: ./pico_w/Gameberry/

- name: Setup Python
uses: actions/[email protected]

- name: Clone micropython_data_to_py
run: |
git clone https://github.com/peterhinch/micropython_data_to_py.git
- name: Convert data to python
run: |
./micropython_data_to_py/data_to_py.py ./pico_w/Gameberry/boot_config.json ./pico_w/Gameberry/boot_config.py
./micropython_data_to_py/data_to_py.py ./pico_w/Gameberry/default/settings_default.json ./pico_w/Gameberry/default/settings_default.py
./micropython_data_to_py/data_to_py.py ./pico_w/Gameberry/translations/pl.json ./pico_w/Gameberry/translations/pl.py
./micropython_data_to_py/data_to_py.py ./pico_w/Gameberry/translations/en.json ./pico_w/Gameberry/translations/en.py
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: converted-files-pico_w
path: |
./pico_w/Gameberry/
build:
runs-on: ubuntu-latest
needs: json-to-python

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download Minified Files
uses: actions/download-artifact@v3
with:
name: converted-files-pico_w
path: ./pico_w/Gameberry/

- name: Update apt-get
run: |
sudo apt-get update
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential python3 python3-pip libffi-dev pkg-config
pip3 install pyparsing
- name: Clone MicroPython
run: |
git clone --depth 1 https://github.com/micropython/micropython.git
cd micropython
git submodule update --init --recursive
- name: Build mpy-cross
run: |
cd micropython/mpy-cross
make clean
make
cd ..
cd ..
- name: Add boot.py to _boot.py
run: |
cd micropython/ports/rp2
ls ./modules
cat ./modules/_boot.py
cat ./modules/_boot_fat.py
cat /home/runner/work/GameBerry/GameBerry/pico_w/Gameberry/boot.py >> ./modules/_boot.py
cat /home/runner/work/GameBerry/GameBerry/pico_w/Gameberry/boot.py >> ./modules/_boot_fat.py
cat ./modules/_boot.py
cat ./modules/_boot_fat.py
cd ..
cd ..
cd ..
- name: Build Raspberry Pi Pico W
run: |
cd micropython/ports/rp2
make clean
make BOARD=RPI_PICO_W FROZEN_MANIFEST=/home/runner/work/GameBerry/GameBerry/pico_w/Gameberry/manifest.py
- name: Upload Firmware Artifact
uses: actions/upload-artifact@v3
with:
name: pico_w_uf2
path: |
micropython/ports/rp2/build-RPI_PICO_W/firmware.uf2
- name: Get short commit SHA
id: get_short_sha
run: echo "short_sha=${GITHUB_SHA::7}" >> $GITHUB_ENV


- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.short_sha }}
release_name: ${{github.sha}}
draft: false
prerelease: true

- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: micropython/ports/rp2/build-RPI_PICO_W/firmware.uf2
asset_name: RPI_PICO_W.uf2
content_type: application/octet-stream

- uses: eregon/publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ steps.create_release.outputs.id }}
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
settings.json
.vscode/
.micropico
*.code-workspace
__pycache__
extensions.json
octoprint-config.json
# =========================
# Windows detritus
# =========================

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Mac desktop service store files
.DS_Store

_NCrunch*
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-ast
- id: check-json
- id: pretty-format-json
- repo: https://github.com/gitleaks/gitleaks
rev: v8.18.4
hooks:
- id: gitleaks
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Kitki30

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/Kitki30/Gameberry/total?label=Downloads)
# GameBerry

Multi function software for micro controllers.

### Supported micro controllers
- [Raspberry pi pico W / WH](https://github.com/Kitki30/GameBerry/blob/main/pico_w/README.MD)
Loading

0 comments on commit 4b0aa87

Please sign in to comment.