feat: Enhanced Docker Build System with Advanced Version Selection (#186)

* feat: enhance Docker build system with advanced version selection

## New Features
- Add force_rebuild parameter for Docker workflow manual triggers
- Improve version pattern matching with better regex validation
- Add comprehensive Docker Build Guide documentation
- Enhanced logging and error reporting for build process
- Support for prerelease version detection (alpha, beta, rc)

## Improvements
- Better version pattern validation for releases and dev builds
- More detailed build logs with context and warnings
- Clear documentation for all Docker image variants and use cases
- Updated README with Docker version examples and guide reference

## Documentation
- New comprehensive Docker Build Guide (docs/DOCKER_BUILD_GUIDE.md)
- Updated README with version-specific Docker examples
- Workflow dependency diagram and troubleshooting guide
- Complete reference for all supported version patterns

This enhancement provides a robust, well-documented Docker build system
that supports flexible version selection while maintaining deterministic
build behavior without fallback mechanisms.

* fix: simplify dev version regex pattern in docker workflow

* fix: simplify version number regex pattern in docker workflow

* feat: remove docs directory
This commit is contained in:
安正超
2025-07-12 11:31:00 +08:00
committed by GitHub
parent a8fbced928
commit a4d49a500f
2 changed files with 40 additions and 19 deletions

View File

@@ -60,6 +60,11 @@ on:
required: false
default: "main-latest"
type: string
force_rebuild:
description: "Force rebuild even if binary exists (useful for testing)"
required: false
default: false
type: boolean
env:
CARGO_TERM_COLOR: always
@@ -111,30 +116,41 @@ jobs:
# Manual trigger with version input
input_version="${{ github.event.inputs.version }}"
version="${input_version}"
force_rebuild="${{ github.event.inputs.force_rebuild }}"
echo "🎯 Manual Docker build triggered:"
echo " 📋 Requested version: $input_version"
echo " 🔧 Force rebuild: $force_rebuild"
case "$input_version" in
"latest")
build_type="release"
create_latest=true
echo "🚀 Docker manual build with latest version"
echo "🚀 Building with latest stable release version"
;;
"main-latest")
build_type="development"
version="main-latest"
echo "🛠️ Docker manual build with main-latest version"
echo "🛠️ Building with main branch latest development version"
;;
v*.*.*)
v[0-9]*)
build_type="release"
create_latest=true
echo "📦 Docker manual build with specific release version: $input_version"
echo "📦 Building with specific release version: $input_version"
;;
dev-*)
v*alpha*|v*beta*|v*rc*)
build_type="prerelease"
is_prerelease=true
echo "🧪 Building with prerelease version: $input_version"
;;
dev-[a-f0-9]*)
build_type="development"
echo "🔧 Docker manual build with specific dev version: $input_version"
echo "🔧 Building with specific development version: $input_version"
;;
*)
build_type="development"
echo "🔧 Docker manual build with custom version: $input_version"
echo "🔧 Building with custom version: $input_version"
echo "⚠️ Warning: Custom version format may not follow standard patterns"
;;
esac
elif [[ "${{ startsWith(github.ref, 'refs/tags/') }}" == "true" ]]; then