diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..60c86b9 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,60 @@ +name: Build Workflow for elm327-emulator.exe/zip + +on: + push: + branches: [ master ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ master ] + +jobs: + build-windows: + runs-on: windows-latest + steps: + - name: Git Checkout + uses: actions/checkout@v4 + + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + architecture: 'x64' + + - name: Install Python Requirements + run: | + python -m pip install --upgrade pip + #pip install git+https://github.com/pyinstaller/pyinstaller@develop + pip install pyinstaller + pip install . + + - name: Create wrapper + run: | + echo "import sys + from elm import main + sys.exit(main())" > elm327-emulator.py + shell: pwsh + + - name: Run PyInstaller to produce the exe file + run: | + python -m PyInstaller --onefile elm327-emulator.py --name elm327-emulator --collect-all elm + + - name: Zip the elm327-emulator.exe asset to elm327-emulator.zip + run: | + Compress-Archive dist/elm327-emulator.exe dist/elm327-emulator.zip + shell: pwsh + + - name: Generate Changelog + run: > + echo "The *elm327-emulator.exe* executable file in the + *elm327-emulator.zip* archive within the assets below is + auto-generated by a [GitHub Action](.github/workflows/build.yml)." + > ${{ github.workspace }}-CHANGELOG.txt + + - name: Create Release, uploading the elm327-emulator.zip asset + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + body_path: ${{ github.workspace }}-CHANGELOG.txt + files: dist/elm327-emulator.zip + append_body: true + generate_release_notes: true diff --git a/.github/workflows/python-syntax-checker.yml b/.github/workflows/python-syntax-checker.yml index ec3d376..8366f67 100644 --- a/.github/workflows/python-syntax-checker.yml +++ b/.github/workflows/python-syntax-checker.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: # version range and latest minor release (possibly 3.9.1) - python-version: [3.6, 3.7, 3.8, '3.x'] + python-version: [3.7, 3.8, '3.x'] steps: - uses: actions/checkout@v2 diff --git a/README.md b/README.md index 7bac1ca..a93b584 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,10 @@ python3 -m elm -n 35000 All subsequent information is not needed for basic usage of the tool and allows mastering *ELM327-emulator*, exploiting it to test specific features including the simulation of communication exceptions, which are not always easy to be reproduced with a real link. +# Running the pre-built executable program + +The *elm327-emulator.zip* archive in the [Releases](https://github.com/Ircama/elm327-emulator/releases/latest) folder incudes the *elm327-emulator.exe* executable asset; the ZIP archive is auto-generated by a [GitHub Action](.github/workflows/build.yml). *elm327-emulator.exe* is a Windows application that can be directly executed. + # Compatibility *ELM327-emulator* has been tested with Python 3.6, 3.7, 3.8, 3.9. Previous Python versions are not supported. diff --git a/elm/interpreter.py b/elm/interpreter.py index fe8281d..91d598f 100644 --- a/elm/interpreter.py +++ b/elm/interpreter.py @@ -227,9 +227,11 @@ def print_topics(self, header, cmds, cmdlen, maxcol): if self.args.batch_mode: return self.stdout.write( + "Available commands include the following list (type help " "\nfor more information on each command). Besides, any Python" "\ncommand is accepted. Autocompletion is fully allowed." + "\nVisit https://github.com/Ircama/ELM327-emulator for additional info." "\n==============================================================" "==\n") self.columnize(cmds, maxcol-1)