Skip to content

Commit 7e65f28

Browse files
Batch analysis and Linux binaries
1 parent a922e09 commit 7e65f28

33 files changed

Lines changed: 3606 additions & 2558 deletions
Lines changed: 95 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: Test, Windows build and release
2+
name: Test, build and release
33

44
"on":
55
push:
@@ -48,6 +48,68 @@ jobs:
4848
- name: Run static checks
4949
run: bash scripts/sh/lint.sh
5050

51+
build-linux:
52+
name: Build Linux executables
53+
needs: test-linux
54+
runs-on: ubuntu-latest
55+
timeout-minutes: 30
56+
57+
steps:
58+
- name: Check out repository
59+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
60+
61+
- name: Install Qt runtime libraries
62+
run: |
63+
sudo apt-get update
64+
sudo apt-get install --yes --no-install-recommends libegl1 libgl1
65+
66+
- name: Install uv and Python
67+
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9
68+
with:
69+
version: "0.12.9"
70+
python-version: "3.13"
71+
enable-cache: true
72+
cache-dependency-glob: uv.lock
73+
74+
- name: Verify release tag matches project version
75+
if: startsWith(github.ref, 'refs/tags/')
76+
run: |
77+
version=$(uv version --short)
78+
if [[ "v$version" != "$GITHUB_REF_NAME" ]]; then
79+
printf 'Tag %s does not match pyproject version v%s\n' "$GITHUB_REF_NAME" "$version" >&2
80+
exit 1
81+
fi
82+
83+
- name: Build executables
84+
run: bash scripts/sh/build.sh --skip-tests
85+
86+
- name: Smoke test packaged CLI
87+
run: |
88+
./dist/easy_gcode_plot_cli --help
89+
bash scripts/sh/batch/batch_mill.sh
90+
bash scripts/sh/batch/batch_turn.sh
91+
92+
- name: Package Linux executables
93+
run: |
94+
version=$(uv version --short)
95+
archive="Easy-G-Code-Plot-$version-Linux-x64.tar.gz"
96+
test -x dist/easy_gcode_plot
97+
test -x dist/easy_gcode_plot_cli
98+
tar -C dist -czf "dist/$archive" easy_gcode_plot easy_gcode_plot_cli
99+
(cd dist && sha256sum "$archive" > "$archive.sha256")
100+
(cd dist && sha256sum -c "$archive.sha256")
101+
tar -tzf "dist/$archive"
102+
103+
- name: Upload Linux artifact
104+
uses: actions/upload-artifact@v7
105+
with:
106+
name: Easy-G-Code-Plot-Linux-x64
107+
path: |
108+
dist/Easy-G-Code-Plot-*-Linux-x64.tar.gz
109+
dist/Easy-G-Code-Plot-*-Linux-x64.tar.gz.sha256
110+
if-no-files-found: error
111+
retention-days: 14
112+
51113
build:
52114
name: Test and build Windows EXE
53115
runs-on: windows-latest
@@ -95,30 +157,39 @@ jobs:
95157
shell: pwsh
96158
run: ./scripts/ps1/build.ps1 -SkipTests
97159

98-
- name: Give executable a versioned name
160+
- name: Smoke test packaged CLI
161+
shell: pwsh
162+
run: |
163+
& dist/easy_gcode_plot_cli.exe --help
164+
if ($LASTEXITCODE -ne 0) { throw "Packaged CLI failed to start." }
165+
166+
- name: Give executables versioned names
99167
shell: pwsh
100168
run: |
101169
$version = uv version --short
102170
$releaseExe = "dist/Easy-G-Code-Plot-$version-Windows-x64.exe"
171+
$releaseCli = "dist/easy_gcode_plot_cli.exe"
103172
Copy-Item dist/easy_gcode_plot.exe $releaseExe
104-
$hash = (Get-FileHash $releaseExe -Algorithm SHA256).Hash.ToLower()
105-
"$hash $(Split-Path $releaseExe -Leaf)" |
106-
Set-Content dist/SHA256SUMS.txt -Encoding ascii
173+
@($releaseExe, $releaseCli) | ForEach-Object {
174+
$hash = (Get-FileHash $_ -Algorithm SHA256).Hash.ToLower()
175+
"$hash $(Split-Path $_ -Leaf)"
176+
} | Set-Content dist/SHA256SUMS.txt -Encoding ascii
107177
108178
- name: Upload executable artifact
109179
uses: actions/upload-artifact@v7
110180
with:
111181
name: Easy-G-Code-Plot-Windows-x64
112182
path: |
113183
dist/Easy-G-Code-Plot-*-Windows-x64.exe
184+
dist/easy_gcode_plot_cli.exe
114185
dist/SHA256SUMS.txt
115186
if-no-files-found: error
116187
retention-days: 14
117188

118189
release:
119190
name: Publish GitHub Release
120191
if: startsWith(github.ref, 'refs/tags/v')
121-
needs: [build, test-linux]
192+
needs: [build, build-linux]
122193
runs-on: windows-latest
123194
permissions:
124195
contents: write
@@ -134,22 +205,33 @@ jobs:
134205
name: Easy-G-Code-Plot-Windows-x64
135206
path: dist
136207

137-
- name: Create release or replace its executable
208+
- name: Download Linux artifact
209+
uses: actions/download-artifact@v8
210+
with:
211+
name: Easy-G-Code-Plot-Linux-x64
212+
path: dist/linux
213+
214+
- name: Create release or replace its executables
138215
shell: pwsh
139216
env:
140217
GH_TOKEN: ${{ github.token }}
141218
run: |
142219
$tag = "${{ github.ref_name }}"
143-
$asset = (
144-
Get-ChildItem dist/Easy-G-Code-Plot-*-Windows-x64.exe `
145-
-File -ErrorAction Stop
146-
).FullName
220+
$guiAsset = @(Get-ChildItem dist/Easy-G-Code-Plot-*-Windows-x64.exe -File -ErrorAction Stop)
221+
if ($guiAsset.Count -ne 1) { throw "Expected exactly one GUI executable." }
222+
$assets = @($guiAsset[0].FullName, (Resolve-Path dist/easy_gcode_plot_cli.exe).Path)
147223
$checksum = (Resolve-Path dist/SHA256SUMS.txt).Path
224+
$linuxAsset = @(Get-ChildItem dist/linux/Easy-G-Code-Plot-*-Linux-x64.tar.gz -File -ErrorAction Stop)
225+
if ($linuxAsset.Count -ne 1) { throw "Expected exactly one Linux archive." }
226+
$linuxChecksum = (Resolve-Path "$($linuxAsset[0].FullName).sha256").Path
227+
$assets += $linuxAsset[0].FullName
228+
$assets += $checksum
229+
$assets += $linuxChecksum
148230
149231
if (gh release view $tag 2>$null) {
150-
gh release upload $tag $asset $checksum --clobber
232+
gh release upload $tag @assets --clobber
151233
} else {
152-
gh release create $tag $asset $checksum `
234+
gh release create $tag @assets `
153235
--verify-tag --generate-notes --title "Easy G-Code Plot $tag"
154236
}
155237

‎CHANGELOG.md‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Changelog
22

3+
## 1.6.5 - 2026-09-25
4+
5+
- Linux releases now include a versioned x64 archive with GUI and CLI executables plus a SHA-256 checksum. CI builds and smoke-tests both batch presets before publication.
6+
- Replaced terminal JSON dumps with readable execution results for every CLI command. Batch now reports each file as it is processed, followed by final counts and report paths; detailed JSON remains available in output files.
7+
- Added ready-to-run PowerShell and Linux shell batch presets for the bundled milling and turning fixtures. They use UTF-8, write separate reports to the system temporary directory, and run the built CLI without building or running tests. Milling batch analysis now detects Arc Type per program, with relative IJK as the fallback.
8+
- Added recursive CLI batch analysis for turning and milling NC files, with JSON and Excel-friendly CSV reports, diagnostic counts, unsupported G/M-code summaries and selectable file extensions.
9+
- Defined report statuses as `CLEAN`, `WARNINGS`, `ERRORS` and `NO_FILES`, with a nonzero exit code for errors or an empty scan. File read/decode failures remain per-file diagnostics; unexpected analyzer failures surface directly. Bumped the report schema to version 2.
10+
- Unified GUI and CLI program execution through one shared setup path and the authoritative CNC kernel. Temporary tool discovery now supplies G41/G42 geometry to single-file and batch CLI runs, while GUI manual tool assignments retain priority.
11+
- Built a separate console CLI executable alongside the windowed GUI. Windows releases publish both executables and a SHA-256 checksum list; local Windows and Linux builds write `.sha256` files beside their executables. Top-level CLI help now lists every command's arguments and defaults; packaged and source commands are documented.
12+
- Set Python 3.13 as the minimum source runtime and aligned the lint target and lock file with the supported environments.
13+
- Highlighted fenced command examples in the built-in FAQ with a contrasting background and padding.
14+
- Aligned PowerShell and shell helpers: lint resource checks, release lint gates, build checksum output, test arguments and startup arguments. Updated build and release documentation.
15+
- Verified the Ubuntu WSL shell workflow: dependency sync, Qt source generation, lint with resource checks, 933 passing tests, CLI packaging, checksums and both batch presets. Fixed first-run native build state handling and completed the turning preset.
16+
- Made exported project ZIPs portable to Linux by using forward-slash entry paths and LF line endings for shell scripts.
17+
318
## 1.6.4 - 2026-09-24
419

520
- Reworked **Options → Hotkeys** into a table covering named menu commands, including nested commands. A separate assignment dialog offers modifier checkboxes and a searchable key list; shortcuts persist per command, can be cleared or restored to defaults, and conflicting assignments are rejected. Default shortcuts were updated for Refresh and standard views.

‎FAQ.md‎

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ Easy G-Code Plot is a desktop editor, analyzer, simulator and trace exporter for
2828

2929
### How do I install it?
3030

31-
The simplest Windows installation is the standalone executable from [GitHub Releases](https://github.com/MaestroFusion360/easy_gcode_plot/releases). It does not require a separate Python installation.
31+
Download the Windows GUI and CLI executables or the Linux x64 archive containing both from [GitHub Releases](https://github.com/MaestroFusion360/easy_gcode_plot/releases). Neither requires a Python installation. Verify the Linux archive with its `.sha256` file before extracting it.
3232

33-
To run from source, install Python 3.11+, [uv](https://docs.astral.sh/uv/) and a C compiler (Visual Studio Build Tools with **Desktop development with C++** on Windows, or the platform compiler and Python development headers on Linux/macOS), then run:
33+
To run from source, install Python 3.13+, [uv](https://docs.astral.sh/uv/) and a C compiler (Visual Studio Build Tools with **Desktop development with C++** on Windows, or a platform compiler and Python development headers on Linux), then run:
3434

3535
```bash
3636
git clone https://github.com/MaestroFusion360/easy_gcode_plot.git
@@ -441,16 +441,38 @@ Press Refresh. The automatic sampled-segment limit is intended to prevent expens
441441

442442
## CLI
443443

444-
The GUI and CLI share the same kernel:
444+
The GUI and CLI share the same kernel. Run the Windows release CLI from its folder in PowerShell:
445+
446+
```powershell
447+
.\easy_gcode_plot_cli.exe parse program.nc --lang fanuc_turn
448+
.\easy_gcode_plot_cli.exe trace program.nc --lang fanuc_turn -o trace.json
449+
.\easy_gcode_plot_cli.exe analyze program.nc --lang fanuc_turn
450+
.\easy_gcode_plot_cli.exe batch .\programs --lang fanuc_mill -o batch-report
451+
.\easy_gcode_plot_cli.exe export program.nc --lang fanuc_turn -o expanded.nc
452+
```
453+
454+
From the repository root, use `.\dist\easy_gcode_plot_cli.exe`. To run from source, replace `.\easy_gcode_plot_cli.exe` with `uv run --no-dev python -m app`.
455+
456+
To analyze the bundled fixtures with the already built executable, run a preset script without arguments:
457+
458+
```powershell
459+
.\scripts\ps1\batch\batch_mill.ps1
460+
.\scripts\ps1\batch\batch_turn.ps1
461+
```
445462

446463
```bash
447-
uv run --no-dev python -m app parse program.nc --lang fanuc_turn
448-
uv run --no-dev python -m app trace program.nc --lang fanuc_turn -o trace.json
449-
uv run --no-dev python -m app analyze program.nc --lang fanuc_turn
450-
uv run --no-dev python -m app export program.nc --lang fanuc_turn -o expanded.nc
464+
bash scripts/sh/batch/batch_mill.sh
465+
bash scripts/sh/batch/batch_turn.sh
451466
```
452467

453-
Use `--encoding cp1251` for Windows-1251 input. Export modes include `program` and `cycles`; use `--lang fanuc_mill` for milling.
468+
The scripts use UTF-8, read `tests/fixtures/milling` or `tests/fixtures/turning`, and write reports under the system temporary directory in `easy_gcode_plot/batch/milling` or `easy_gcode_plot/batch/turning`. They do not build or run tests. Milling batch analysis detects Arc Type for each file from IJK arcs. If the file has no unambiguous arc, the kernel uses relative IJK.
469+
The terminal shows each batch file as it is processed, its diagnostics, and the final result. All CLI commands print a readable execution result in the terminal. `trace` and `analyze` write detailed JSON only when `-o` is supplied; `batch` writes JSON and CSV reports to its output directory.
470+
471+
Use `--encoding cp1251` for Windows-1251 input. Export modes include `program` and `cycles`; use `--lang fanuc_mill` for milling. `batch` writes detailed JSON and Excel-friendly CSV reports with per-file `CLEAN` / `WARNINGS` / `ERRORS` status, diagnostic totals and aggregated unsupported G/M codes. `CLEAN` means no diagnostics from this analyzer, not machine validation. An empty scan has overall status `NO_FILES` and a nonzero exit code. It scans `.nc`, `.cnc`, `.ptp`, `.tap` and `.txt` recursively by default; override with `--extensions` or `--top-level-only`.
472+
473+
CLI runs use the same temporary tool discovery as the GUI for a newly opened program: literal `T` words and nearby comments determine geometry for G41/G42. The GUI's manually assigned Current Program tools and Saved Library are separate from that discovery and are not loaded by the CLI. Check inferred tool dimensions before using a compensated trace.
474+
475+
Download `easy_gcode_plot_cli.exe` from the Windows release. For example, run `.\easy_gcode_plot_cli.exe batch C:\Programs --lang fanuc_mill -o C:\Reports` in PowerShell. Run `.\easy_gcode_plot_cli.exe --help` for all commands and their parameters, or `.\easy_gcode_plot_cli.exe batch --help` for batch alone.
454476

455477
## Development
456478

@@ -502,12 +524,26 @@ Generated Python modules must not be edited manually. PySide6 supplies maintaine
502524

503525
### How do I build or release?
504526

527+
On Windows:
528+
505529
```powershell
506530
.\scripts\ps1\build.ps1
507531
$version = "X.Y.Z"
508532
.\scripts\ps1\release.ps1 -Version $version -Message "Release $version"
509533
```
510534

535+
On Linux, use `bash scripts/sh/build.sh` and `bash scripts/sh/release.sh X.Y.Z "Release X.Y.Z"`. The build scripts run tests by default, produce separate GUI and CLI executables, and write SHA-256 `.sha256` files next to them in `dist/`. Use `-Console` / `--console` for only the CLI, or `-SkipTests` / `--skip-tests` if tests have already run. Both release scripts format and lint with resource verification before tests and creating a release commit and tag.
536+
537+
For an Ubuntu or WSL console-only build after tests have passed:
538+
539+
```bash
540+
bash scripts/sh/build.sh --console --skip-tests
541+
./dist/easy_gcode_plot_cli --help
542+
(cd dist && sha256sum -c easy_gcode_plot_cli.sha256)
543+
```
544+
545+
The Linux executable runs in Linux, including WSL; it cannot be started as a Windows `.exe`. The release script needs a Git checkout, including `.git`. An exported source ZIP can build the CLI but cannot create a release commit or tag.
546+
511547
Native/release tooling uses a separate persistent `.venv-build`; it does not
512548
replace or prune the developer `.venv`. `build-native.ps1`/`build-native.sh`
513549
synchronize locked build dependencies when `pyproject.toml` or `uv.lock`

0 commit comments

Comments
 (0)