Declutters the repo root by consolidating build-common.sh, build-dist.sh, build-dist-windows.sh, build-dist.ps1, and installer.nsi into build/. Updates all path references in CI workflows, NSIS installer, and documentation.
This commit is contained in:
@@ -34,8 +34,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Cross-build Windows distribution
|
- name: Cross-build Windows distribution
|
||||||
run: |
|
run: |
|
||||||
chmod +x build-dist-windows.sh
|
chmod +x build/build-dist-windows.sh
|
||||||
./build-dist-windows.sh "v${{ inputs.version }}"
|
./build/build-dist-windows.sh "v${{ inputs.version }}"
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
@@ -70,8 +70,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Build Linux distribution
|
- name: Build Linux distribution
|
||||||
run: |
|
run: |
|
||||||
chmod +x build-dist.sh
|
chmod +x build/build-dist.sh
|
||||||
./build-dist.sh "v${{ inputs.version }}"
|
./build/build-dist.sh "v${{ inputs.version }}"
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -135,8 +135,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Cross-build Windows distribution
|
- name: Cross-build Windows distribution
|
||||||
run: |
|
run: |
|
||||||
chmod +x build-dist-windows.sh
|
chmod +x build/build-dist-windows.sh
|
||||||
./build-dist-windows.sh "${{ gitea.ref_name }}"
|
./build/build-dist-windows.sh "${{ gitea.ref_name }}"
|
||||||
|
|
||||||
- name: Upload build artifacts
|
- name: Upload build artifacts
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
@@ -207,8 +207,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Build Linux distribution
|
- name: Build Linux distribution
|
||||||
run: |
|
run: |
|
||||||
chmod +x build-dist.sh
|
chmod +x build/build-dist.sh
|
||||||
./build-dist.sh "${{ gitea.ref_name }}"
|
./build/build-dist.sh "${{ gitea.ref_name }}"
|
||||||
|
|
||||||
- name: Upload build artifact
|
- name: Upload build artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
|
|||||||
+10
-1
@@ -4,7 +4,16 @@ __pycache__/
|
|||||||
*$py.class
|
*$py.class
|
||||||
*.so
|
*.so
|
||||||
.Python
|
.Python
|
||||||
build/
|
# Build output artifacts (LedGrab/, *.zip, *.exe, *.tar.gz, cached downloads)
|
||||||
|
build/LedGrab/
|
||||||
|
build/*.zip
|
||||||
|
build/*.exe
|
||||||
|
build/*.tar.gz
|
||||||
|
build/*.msi
|
||||||
|
build/python-embed-*.zip
|
||||||
|
build/pip-wheels/
|
||||||
|
build/win-wheels/
|
||||||
|
build/tk-extract/
|
||||||
develop-eggs/
|
develop-eggs/
|
||||||
dist/
|
dist/
|
||||||
downloads/
|
downloads/
|
||||||
|
|||||||
@@ -14,10 +14,11 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
BUILD_DIR="$SCRIPT_DIR/build"
|
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||||
|
BUILD_DIR="$SCRIPT_DIR"
|
||||||
DIST_NAME="LedGrab"
|
DIST_NAME="LedGrab"
|
||||||
DIST_DIR="$BUILD_DIR/$DIST_NAME"
|
DIST_DIR="$BUILD_DIR/$DIST_NAME"
|
||||||
SERVER_DIR="$SCRIPT_DIR/server"
|
SERVER_DIR="$REPO_ROOT/server"
|
||||||
PYTHON_DIR="$DIST_DIR/python"
|
PYTHON_DIR="$DIST_DIR/python"
|
||||||
APP_DIR="$DIST_DIR/app"
|
APP_DIR="$DIST_DIR/app"
|
||||||
PYTHON_VERSION="${PYTHON_VERSION:-3.11.9}"
|
PYTHON_VERSION="${PYTHON_VERSION:-3.11.9}"
|
||||||
@@ -340,7 +341,7 @@ sed -i 's/$/\r/' "$DIST_DIR/LedGrab.bat"
|
|||||||
|
|
||||||
# Copy hidden launcher VBS
|
# Copy hidden launcher VBS
|
||||||
mkdir -p "$DIST_DIR/scripts"
|
mkdir -p "$DIST_DIR/scripts"
|
||||||
cp server/scripts/start-hidden.vbs "$DIST_DIR/scripts/"
|
cp "$SERVER_DIR/scripts/start-hidden.vbs" "$DIST_DIR/scripts/"
|
||||||
|
|
||||||
# ── Create autostart scripts ─────────────────────────────────
|
# ── Create autostart scripts ─────────────────────────────────
|
||||||
|
|
||||||
@@ -34,11 +34,11 @@ param(
|
|||||||
$ErrorActionPreference = 'Stop'
|
$ErrorActionPreference = 'Stop'
|
||||||
$ProgressPreference = 'SilentlyContinue' # faster downloads
|
$ProgressPreference = 'SilentlyContinue' # faster downloads
|
||||||
|
|
||||||
$ScriptRoot = $PSScriptRoot
|
$RepoRoot = Split-Path $PSScriptRoot -Parent
|
||||||
$BuildDir = Join-Path $ScriptRoot "build"
|
$BuildDir = $PSScriptRoot
|
||||||
$DistName = "LedGrab"
|
$DistName = "LedGrab"
|
||||||
$DistDir = Join-Path $BuildDir $DistName
|
$DistDir = Join-Path $BuildDir $DistName
|
||||||
$ServerDir = Join-Path $ScriptRoot "server"
|
$ServerDir = Join-Path $RepoRoot "server"
|
||||||
$PythonDir = Join-Path $DistDir "python"
|
$PythonDir = Join-Path $DistDir "python"
|
||||||
$AppDir = Join-Path $DistDir "app"
|
$AppDir = Join-Path $DistDir "app"
|
||||||
|
|
||||||
@@ -10,10 +10,11 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
BUILD_DIR="$SCRIPT_DIR/build"
|
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||||
|
BUILD_DIR="$SCRIPT_DIR"
|
||||||
DIST_NAME="LedGrab"
|
DIST_NAME="LedGrab"
|
||||||
DIST_DIR="$BUILD_DIR/$DIST_NAME"
|
DIST_DIR="$BUILD_DIR/$DIST_NAME"
|
||||||
SERVER_DIR="$SCRIPT_DIR/server"
|
SERVER_DIR="$REPO_ROOT/server"
|
||||||
VENV_DIR="$DIST_DIR/venv"
|
VENV_DIR="$DIST_DIR/venv"
|
||||||
APP_DIR="$DIST_DIR/app"
|
APP_DIR="$DIST_DIR/app"
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
!endif
|
!endif
|
||||||
|
|
||||||
Name "${APPNAME} v${VERSION}"
|
Name "${APPNAME} v${VERSION}"
|
||||||
OutFile "build\${APPNAME}-v${VERSION}-win-x64-setup.exe"
|
OutFile "${APPNAME}-v${VERSION}-win-x64-setup.exe"
|
||||||
InstallDir "$LOCALAPPDATA\${APPNAME}"
|
InstallDir "$LOCALAPPDATA\${APPNAME}"
|
||||||
InstallDirRegKey HKCU "Software\${APPNAME}" "InstallDir"
|
InstallDirRegKey HKCU "Software\${APPNAME}" "InstallDir"
|
||||||
RequestExecutionLevel user
|
RequestExecutionLevel user
|
||||||
@@ -30,8 +30,8 @@ SetCompressor /SOLID lzma
|
|||||||
|
|
||||||
; ── Modern UI Configuration ─────────────────────────────────
|
; ── Modern UI Configuration ─────────────────────────────────
|
||||||
|
|
||||||
!define MUI_ICON "server\src\ledgrab\static\icons\icon.ico"
|
!define MUI_ICON "..\server\src\ledgrab\static\icons\icon.ico"
|
||||||
!define MUI_UNICON "server\src\ledgrab\static\icons\icon.ico"
|
!define MUI_UNICON "..\server\src\ledgrab\static\icons\icon.ico"
|
||||||
!define MUI_ABORTWARNING
|
!define MUI_ABORTWARNING
|
||||||
|
|
||||||
; ── Pages ───────────────────────────────────────────────────
|
; ── Pages ───────────────────────────────────────────────────
|
||||||
@@ -100,10 +100,10 @@ Section "!${APPNAME} (required)" SecCore
|
|||||||
Delete "$INSTDIR\LedGrab.bat"
|
Delete "$INSTDIR\LedGrab.bat"
|
||||||
|
|
||||||
; Copy the entire portable build
|
; Copy the entire portable build
|
||||||
File /r "build\LedGrab\python"
|
File /r "LedGrab\python"
|
||||||
File /r "build\LedGrab\app"
|
File /r "LedGrab\app"
|
||||||
File /r "build\LedGrab\scripts"
|
File /r "LedGrab\scripts"
|
||||||
File "build\LedGrab\LedGrab.bat"
|
File "LedGrab\LedGrab.bat"
|
||||||
|
|
||||||
; Create data and logs directories
|
; Create data and logs directories
|
||||||
CreateDirectory "$INSTDIR\data"
|
CreateDirectory "$INSTDIR\data"
|
||||||
+8
-8
@@ -17,7 +17,7 @@ Four parallel jobs triggered by pushing a `v*` tag:
|
|||||||
Creates the Gitea release with a description table listing all artifacts. **The description must stay in sync with actual build outputs** — if you add/remove/rename an artifact, update the body template here.
|
Creates the Gitea release with a description table listing all artifacts. **The description must stay in sync with actual build outputs** — if you add/remove/rename an artifact, update the body template here.
|
||||||
|
|
||||||
### 2. `build-windows` (cross-built from Linux)
|
### 2. `build-windows` (cross-built from Linux)
|
||||||
- Runs `build-dist-windows.sh` on Ubuntu with NSIS + msitools
|
- Runs `build/build-dist-windows.sh` on Ubuntu with NSIS + msitools
|
||||||
- Downloads Windows embedded Python 3.11 + pip wheels cross-platform
|
- Downloads Windows embedded Python 3.11 + pip wheels cross-platform
|
||||||
- Bundles tkinter from Python MSI via msiextract
|
- Bundles tkinter from Python MSI via msiextract
|
||||||
- Builds frontend (`npm run build`)
|
- Builds frontend (`npm run build`)
|
||||||
@@ -25,7 +25,7 @@ Creates the Gitea release with a description table listing all artifacts. **The
|
|||||||
- Produces: **`LedGrab-{tag}-win-x64.zip`** (portable) and **`LedGrab-{tag}-setup.exe`** (NSIS installer)
|
- Produces: **`LedGrab-{tag}-win-x64.zip`** (portable) and **`LedGrab-{tag}-setup.exe`** (NSIS installer)
|
||||||
|
|
||||||
### 3. `build-linux`
|
### 3. `build-linux`
|
||||||
- Runs `build-dist.sh` on Ubuntu
|
- Runs `build/build-dist.sh` on Ubuntu
|
||||||
- Creates a venv, installs deps, builds frontend
|
- Creates a venv, installs deps, builds frontend
|
||||||
- Produces: **`LedGrab-{tag}-linux-x64.tar.gz`**
|
- Produces: **`LedGrab-{tag}-linux-x64.tar.gz`**
|
||||||
|
|
||||||
@@ -38,8 +38,8 @@ Creates the Gitea release with a description table listing all artifacts. **The
|
|||||||
|
|
||||||
| Script | Platform | Output |
|
| Script | Platform | Output |
|
||||||
|--------|----------|--------|
|
|--------|----------|--------|
|
||||||
| `build-dist-windows.sh` | Linux → Windows cross-build | ZIP + NSIS installer |
|
| `build/build-dist-windows.sh` | Linux → Windows cross-build | ZIP + NSIS installer |
|
||||||
| `build-dist.sh` | Linux native | tarball |
|
| `build/build-dist.sh` | Linux native | tarball |
|
||||||
| `server/Dockerfile` | Docker | Container image |
|
| `server/Dockerfile` | Docker | Container image |
|
||||||
|
|
||||||
## Release Versioning
|
## Release Versioning
|
||||||
@@ -71,7 +71,7 @@ Build scripts use a fallback chain: CLI argument → exact git tag → CI env va
|
|||||||
- **Launch after install**: Use `MUI_FINISHPAGE_RUN_FUNCTION` (not `MUI_FINISHPAGE_RUN_PARAMETERS` — NSIS `Exec` chokes on quoting). Still requires `MUI_FINISHPAGE_RUN ""` defined for checkbox visibility
|
- **Launch after install**: Use `MUI_FINISHPAGE_RUN_FUNCTION` (not `MUI_FINISHPAGE_RUN_PARAMETERS` — NSIS `Exec` chokes on quoting). Still requires `MUI_FINISHPAGE_RUN ""` defined for checkbox visibility
|
||||||
- **Detect running instance**: `.onInit` checks file lock on `python.exe`, offers to kill process before install
|
- **Detect running instance**: `.onInit` checks file lock on `python.exe`, offers to kill process before install
|
||||||
- **Uninstall preserves user data**: Remove `python/`, `app/`, `logs/` but NOT `data/`
|
- **Uninstall preserves user data**: Remove `python/`, `app/`, `logs/` but NOT `data/`
|
||||||
- **CI build**: `sudo apt-get install -y nsis msitools zip` then `makensis -DVERSION="${VERSION}" installer.nsi`
|
- **CI build**: `sudo apt-get install -y nsis msitools zip` then `makensis -DVERSION="${VERSION}" build/installer.nsi`
|
||||||
|
|
||||||
## Hidden Launcher (VBS)
|
## Hidden Launcher (VBS)
|
||||||
|
|
||||||
@@ -135,12 +135,12 @@ The `create-release` job has fallback logic — if the release already exists fo
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm ci && npm run build # frontend
|
npm ci && npm run build # frontend
|
||||||
bash build-dist-windows.sh v1.0.0 # Windows dist
|
bash build/build-dist-windows.sh v1.0.0 # Windows dist
|
||||||
"/c/Program Files (x86)/NSIS/makensis.exe" -DVERSION="1.0.0" installer.nsi # installer
|
"/c/Program Files (x86)/NSIS/makensis.exe" -DVERSION="1.0.0" build/installer.nsi # installer
|
||||||
```
|
```
|
||||||
|
|
||||||
### Iterating on installer only
|
### Iterating on installer only
|
||||||
If only `installer.nsi` changed (not app code), skip the full rebuild — just re-run `makensis`. If app code changed, re-run `build-dist-windows.sh` first since `dist/` is a snapshot.
|
If only `installer.nsi` changed (not app code), skip the full rebuild — just re-run `makensis`. If app code changed, re-run `build/build-dist-windows.sh` first since `dist/` is a snapshot.
|
||||||
|
|
||||||
### Common issues
|
### Common issues
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user