Skip to content

Commit

Permalink
Prepare for release
Browse files Browse the repository at this point in the history
Add GitHub actions support for ruff linting and pyinstaller
Include AutoIt DLL file for ease of building
Use type hints for all functions and variables
Add install.bat script
Update start.bat to use venvs
  • Loading branch information
ElectricityMachine committed Nov 5, 2023
1 parent 7a35ae0 commit 1044a04
Show file tree
Hide file tree
Showing 9 changed files with 119 additions and 70 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Lint and build
on:
workflow_dispatch:

jobs:
ruff:
name: Lint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
with:
args: --output-format github

build:
name: Build binary
runs-on: "windows-latest"
strategy:
fail-fast: false
matrix:
os: ['windows-latest']

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.12
cache: 'pip'
- run: pip install -r requirements.txt pyinstaller
- run: pyinstaller script.py --name sgplus --noconfirm --onefile --add-binary "autoit\AutoItX3_x64.dll;.\autoit\lib" --hidden-import "mouse"
- uses: actions/upload-artifact@v3
with:
path: dist/sgplus.exe
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ cython_debug/

# VSCode
.vscode/*
!.vscode/settings.json
.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
Expand Down
Binary file added autoit/AutoItX3_x64.dll
Binary file not shown.
18 changes: 18 additions & 0 deletions install.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@ECHO OFF
echo "This script will install SG+'s script dependencies and create a virtual environment for you."
echo "If you have not installed Python 3.12, please exit the script and install it from https://python.org"
choice /m "Have you installed Python 3.12?"
if %errorlevel% equ 1 goto confirmed
if %errorlevel% equ 2 goto request_install

:confirmed
echo "Creating venv..."
call python -m venv .venv
echo "Installing dependencies..."
cd ..\..
.venv\Scripts\python.exe -m pip install -r requirements.txt
PAUSE

:request_install
echo "You have indicated you have not installed Python 3.12. Please do so, then run the script again."
PAUSE
2 changes: 0 additions & 2 deletions pyproject.toml

This file was deleted.

4 changes: 1 addition & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
certifi==2023.7.22
charset-normalizer==3.3.1
colorama==0.4.6
idna==3.4
keyboard==0.13.5
mouse==0.7.1
mss==9.0.1
numpy==1.26.1
Pillow==10.1.0
PyAutoIt==0.6.5
pyperclip==1.8.2
Expand Down
Loading

0 comments on commit 1044a04

Please sign in to comment.