Skip to content

Commit a25774e

Browse files
feat: improve CLI build (#218)
* add * Update build-cli.yml * add * Update build-cli.yml Update build-cli.yml Update build-cli.yml Update build-cli.yml Update pyproject.toml
1 parent d65fcd5 commit a25774e

2 files changed

Lines changed: 62 additions & 3 deletions

File tree

.github/workflows/build-cli.yml

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
workflow_dispatch:
1515

1616
jobs:
17-
build-docker:
17+
build-linux:
1818
runs-on: ubuntu-latest
1919
defaults:
2020
run:
@@ -31,4 +31,62 @@ jobs:
3131
run: uv sync --frozen
3232

3333
- name: Build
34+
run: uv run poe nuitka-linux
35+
36+
- name: Show build outputs
37+
run: ls -la
38+
39+
- name: Verify Linux artifact exists
40+
run: |
41+
if ! ls ./app* >/dev/null 2>&1; then
42+
echo "No artifact found"; exit 1
43+
else
44+
echo "Found artifact(s):"; ls ./app*
45+
fi
46+
47+
- name: Upload Linux CLI artifact
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: cli-linux
51+
path: ./src/cli/**/app*
52+
53+
build-windows:
54+
runs-on: windows-latest
55+
defaults:
56+
run:
57+
working-directory: ./src/cli
58+
59+
steps:
60+
- name: Checkout repository
61+
uses: actions/checkout@v6
62+
63+
- name: Install uv
64+
uses: astral-sh/setup-uv@v7
65+
66+
- name: Install deps with uv
67+
run: uv sync --frozen
68+
69+
- name: Build (Windows) via poe
3470
run: uv run poe nuitka
71+
72+
- name: Show build outputs
73+
run: |
74+
Get-ChildItem -Path . -Recurse -File | Select-Object FullName
75+
shell: powershell
76+
77+
- name: Verify Windows artifact exists
78+
run: |
79+
$files = Get-ChildItem -Path . -Filter 'app*.exe' -Recurse -File
80+
if ($files.Count -eq 0) {
81+
Write-Error 'No exe found'
82+
exit 1
83+
} else {
84+
$files | ForEach-Object { Write-Host "Found: $($_.FullName)" }
85+
}
86+
shell: powershell
87+
88+
- name: Upload Windows CLI artifact
89+
uses: actions/upload-artifact@v4
90+
with:
91+
name: cli-windows
92+
path: ./src/cli/**/app*.exe

src/cli/pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ dev = ["poethepoet>=0.39.0"]
2222

2323
[tool.poe.tasks]
2424
# Is not possible to build due to type hint error
25-
nuitka = "nuitka --standalone --onefile --clang --lto=yes --python-flag=-m --python-flag=-OO --disable-bytecode-cache ./app"
26-
nuitka-debug = "nuitka --standalone --onefile --clang --lto=yes --debug --python-flag=-m --python-flag=-OO --disable-bytecode-cache ./app"
25+
nuitka = "nuitka --standalone --onefile --clang --lto=yes --python-flag=-m --python-flag=-OO --disable-bytecode-cache --assume-yes-for-downloads ./app"
26+
nuitka-linux = "nuitka --standalone --onefile --clang --lto=yes --python-flag=-m --python-flag=-OO --disable-bytecode-cache --assume-yes-for-downloads ./app"
27+
nuitka-debug = "nuitka --standalone --onefile --clang --lto=yes --debug --python-flag=-m --python-flag=-OO --disable-bytecode-cache --assume-yes-for-downloads ./app"
2728

2829

2930
[tool.setuptools]

0 commit comments

Comments
 (0)