From 0a66c1d663a459a2fec4dd14c528daf0cc6d210b Mon Sep 17 00:00:00 2001 From: Josh Knapp Date: Thu, 5 Jun 2025 13:54:36 -0700 Subject: [PATCH 1/2] Enhanced project documentation and release automation - Improved README.md formatting and structure - Added installation instructions for pre-built executables - Included platform-specific examples for Windows, Linux, and macOS - Set up Gitea workflow for automated builds on new releases - Added platform-specific PyInstaller spec files for all supported platforms - Updated repository links to point to repo.anhonesthost.net These changes make the project more accessible to new users and streamline the release process with automatic executable generation for all platforms. --- .gitea/workflows/release.yml | 100 +++++++++++++++++++++++++++++++++++ README.md | 82 ++++++++++++++++++++++++---- config.py | 2 +- macropad_linux.spec | 38 +++++++++++++ macropad_macos.spec | 45 ++++++++++++++++ version.txt | 2 +- 6 files changed, 256 insertions(+), 13 deletions(-) create mode 100644 .gitea/workflows/release.yml create mode 100644 macropad_linux.spec create mode 100644 macropad_macos.spec diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..9bd99b5 --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,100 @@ +name: Build and Release + +on: + release: + types: [created] + +jobs: + build-windows: + runs-on: windows-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pyinstaller + pip install -r requirements.txt + + - name: Build executable + run: | + pyinstaller macropad.spec + + - name: Upload Windows artifact + uses: actions/upload-artifact@v3 + with: + name: macropad-windows + path: dist/macropad.exe + + build-linux: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pyinstaller + pip install -r requirements.txt + + - name: Build executable + run: | + pyinstaller macropad_linux.spec + - name: Upload Linux artifact + uses: actions/upload-artifact@v3 + with: + name: macropad-linux + path: dist/macropad + + build-macos: + runs-on: macos-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pyinstaller + pip install -r requirements.txt + + - name: Build executable + run: | + pyinstaller macropad_macos.spec + - name: Upload macOS artifact + uses: actions/upload-artifact@v3 + with: + name: macropad-macos + path: dist/macropad.app + + attach-to-release: + needs: [build-windows, build-linux, build-macos] + runs-on: ubuntu-latest + steps: + - name: Download all artifacts + uses: actions/download-artifact@v3 + + - name: Attach executables to release + uses: softprops/action-gh-release@v1 + with: + files: | + macropad-windows/macropad.exe + macropad-linux/macropad + macropad-macos/macropad.app/**/* diff --git a/README.md b/README.md index 94cf36d..90b6f56 100644 --- a/README.md +++ b/README.md @@ -32,21 +32,25 @@ A versatile MacroPad server application that lets you create, manage, and execut ## Installation +### Method 1: From Source + 1. Clone or download this repository 2. Install the required dependencies: - ```bash - pip install -r requirements.txt - ``` +```bash +pip install -r requirements.txt +``` -## Alternative Installation Method -#### Windows only +### Method 2: Pre-built Executables -1. Create a Folder you wish to run MacroPad from -2. Download ```macropad.exe``` from the ```dist``` folder -3. Accept the security notices, and run the application +1. Go to the [Releases](https://repo.anhonesthost.net/MacroPad/MP-Server/releases) page +2. Download the appropriate version for your operating system: + - Windows: `macropad.exe` + - Linux: `macropad` + - macOS: `macropad.app` +3. Run the downloaded file > [!IMPORTANT] -> The executable is unsigned and may trigger security warnings. You may need to click "More info" and "Run anyway" in Windows SmartScreen or add an exception in your antivirus software. +> The executables are unsigned and may trigger security warnings. You may need to click "More info" and "Run anyway" in Windows SmartScreen, adjust permissions on Linux (`chmod +x macropad`), or override Gatekeeper on macOS. ## Usage @@ -94,11 +98,67 @@ When minimized to the system tray: ### Windows Examples #### Steam Applications -```"C:\Program Files (x86)\Steam\steam.exe" steam://rungameid/2767030``` +``` +"C:\Program Files (x86)\Steam\steam.exe" steam://rungameid/2767030 +``` #### Chrome to a website +``` +"C:\Program Files\Google\Chrome\Application\chrome.exe" http://twitch.tv/shadowdao +``` -```"C:\Program Files\Google\Chrome\Application\chrome.exe" http://twitch.tv/shadowdao``` +#### Run Notepad +``` +notepad.exe +``` +#### Open File Explorer to a specific location +``` +explorer.exe "C:\Users\YourUsername\Documents" +``` + +### Linux Examples + +#### Opening Firefox +``` +firefox https://example.com +``` + +#### Opening Steam +``` +steam steam://rungameid/2767030 +``` + +#### Launch Terminal +``` +gnome-terminal +``` + +#### Open File Manager +``` +nautilus ~/Documents +``` + +### macOS Examples + +#### Opening Safari +``` +open -a Safari https://example.com +``` + +#### Opening Terminal +``` +open -a Terminal +``` + +#### Open Finder to a specific location +``` +open ~/Documents +``` + +#### Launch Applications +``` +open -a "Visual Studio Code" +``` #### Special Thanks to CatArgent_ on Twitch for proof reading my stuff and providing valuable feedback. \ No newline at end of file diff --git a/config.py b/config.py index aa32b4f..ac4a40d 100644 --- a/config.py +++ b/config.py @@ -1,6 +1,6 @@ # Configuration and constants for MacroPad Server -VERSION = "0.8.0 Beta" +VERSION = "0.8.5 Beta" DEFAULT_PORT = 40000 # UI Theme colors diff --git a/macropad_linux.spec b/macropad_linux.spec new file mode 100644 index 0000000..81d3af1 --- /dev/null +++ b/macropad_linux.spec @@ -0,0 +1,38 @@ +# -*- mode: python ; coding: utf-8 -*- + + +a = Analysis( + ['main.py'], + pathex=[], + binaries=[], + datas=[], + hiddenimports=[], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + noarchive=False, + optimize=0, +) +pyz = PYZ(a.pure) + +exe = EXE( + pyz, + a.scripts, + a.binaries, + a.datas, + [], + name='macropad', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=False, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, +) \ No newline at end of file diff --git a/macropad_macos.spec b/macropad_macos.spec new file mode 100644 index 0000000..7c589df --- /dev/null +++ b/macropad_macos.spec @@ -0,0 +1,45 @@ +# -*- mode: python ; coding: utf-8 -*- + + +a = Analysis( + ['main.py'], + pathex=[], + binaries=[], + datas=[], + hiddenimports=[], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + noarchive=False, + optimize=0, +) +pyz = PYZ(a.pure) + +exe = EXE( + pyz, + a.scripts, + a.binaries, + a.datas, + [], + name='macropad', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=False, + disable_windowed_traceback=False, + argv_emulation=True, + target_arch=None, + codesign_identity=None, + entitlements_file=None, +) + +app = BUNDLE( + exe, + name='macropad.app', + icon=None, + bundle_identifier=None, +) \ No newline at end of file diff --git a/version.txt b/version.txt index 8adc70f..bbde4be 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.8.0 \ No newline at end of file +0.8.5 \ No newline at end of file -- 2.43.5 From c80474f5201d577469c7759331c2ca967c9c61b8 Mon Sep 17 00:00:00 2001 From: Josh Knapp Date: Thu, 5 Jun 2025 14:33:03 -0700 Subject: [PATCH 2/2] update to remove mac build because I do not have a mac to build on yet --- .gitea/workflows/release.yml | 98 +++++++++++++++++++++++++----------- 1 file changed, 69 insertions(+), 29 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 9bd99b5..5478169 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -1,11 +1,34 @@ name: Build and Release on: - release: - types: [created] + push: + branches: + - main jobs: + create-release: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Get version + id: get_version + run: | + VERSION=$(cat version.txt) + echo "VERSION=$VERSION" >> $GITHUB_ENV + + - name: Create Release + id: create_release + uses: softprops/action-gh-release@v1 + with: + tag_name: v${{ env.VERSION }} + name: Release v${{ env.VERSION }} + draft: false + prerelease: false + build-windows: + needs: [create-release] runs-on: windows-latest steps: - name: Checkout code @@ -33,6 +56,7 @@ jobs: path: dist/macropad.exe build-linux: + needs: [create-release] runs-on: ubuntu-latest steps: - name: Checkout code @@ -52,49 +76,65 @@ jobs: - name: Build executable run: | pyinstaller macropad_linux.spec + - name: Upload Linux artifact uses: actions/upload-artifact@v3 with: name: macropad-linux path: dist/macropad - build-macos: - runs-on: macos-latest +# MacOS build is temporarily disabled +# Uncomment this section when macOS build environment becomes available +# +# build-macos: +# needs: [create-release] +# runs-on: macos-latest +# steps: +# - name: Checkout code +# uses: actions/checkout@v3 +# +# - name: Set up Python +# uses: actions/setup-python@v4 +# with: +# python-version: '3.11' +# +# - name: Install dependencies +# run: | +# python -m pip install --upgrade pip +# pip install pyinstaller +# pip install -r requirements.txt +# +# - name: Build executable +# run: | +# pyinstaller macropad_macos.spec +# +# - name: Upload macOS artifact +# uses: actions/upload-artifact@v3 +# with: +# name: macropad-macos +# path: dist/macropad.app + + attach-to-release: + needs: [create-release, build-windows, build-linux] + runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.11' - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install pyinstaller - pip install -r requirements.txt - - - name: Build executable - run: | - pyinstaller macropad_macos.spec - - name: Upload macOS artifact - uses: actions/upload-artifact@v3 - with: - name: macropad-macos - path: dist/macropad.app - attach-to-release: - needs: [build-windows, build-linux, build-macos] - runs-on: ubuntu-latest - steps: + - name: Get version + id: get_version + run: | + VERSION=$(cat version.txt) + echo "VERSION=$VERSION" >> $GITHUB_ENV + - name: Download all artifacts uses: actions/download-artifact@v3 - name: Attach executables to release uses: softprops/action-gh-release@v1 with: + tag_name: v${{ env.VERSION }} files: | macropad-windows/macropad.exe macropad-linux/macropad - macropad-macos/macropad.app/**/* +# macropad-macos/macropad.app/**/* -- 2.43.5