Version v0.3.23 - Reorganized project structure - all sources in src/, builds in build/

This commit is contained in:
2025-12-18 08:54:57 -04:00
parent 3ff91e7681
commit a5a1bd92c4
23 changed files with 57 additions and 369 deletions

View File

@@ -148,18 +148,18 @@ update_source_version() {
print_status "Updating version strings in source code..."
# Replace hardcoded version strings in otp.c with the current git tag
if [ -f "otp.c" ]; then
# Replace hardcoded version strings in src/otp.c with the current git tag
if [ -f "src/otp.c" ]; then
# Update main menu version
sed -i "s/OTP v[0-9]\+\.[0-9]\+\.[0-9]\+/OTP $NEW_VERSION/g" otp.c
sed -i "s/OTP v[0-9]\+\.[0-9]\+\.[0-9]\+/OTP $NEW_VERSION/g" src/otp.c
# Update ASCII output version
sed -i "s/Version: v[0-9]\+\.[0-9]\+\.[0-9]\+/Version: $NEW_VERSION/g" otp.c
sed -i "s/Version: v[0-9]\+\.[0-9]\+\.[0-9]\+/Version: $NEW_VERSION/g" src/otp.c
# Update usage/help text version
sed -i "s/Implementation v[0-9]\+\.[0-9]\+\.[0-9]\+/Implementation $NEW_VERSION/g" otp.c
sed -i "s/Implementation v[0-9]\+\.[0-9]\+\.[0-9]\+/Implementation $NEW_VERSION/g" src/otp.c
print_success "Updated version strings in otp.c to $NEW_VERSION"
print_success "Updated version strings in src/otp.c to $NEW_VERSION"
else
print_warning "otp.c not found - skipping version string updates"
print_warning "src/otp.c not found - skipping version string updates"
fi
}
@@ -235,16 +235,16 @@ create_gitea_release() {
if echo "$response" | grep -q '"id"'; then
print_success "Created release $version"
# Upload binaries with descriptive names
upload_release_asset "$api_url" "$token" "$version" "otp-x86_64" "otp-${version}-linux-x86_64"
upload_release_asset "$api_url" "$token" "$version" "otp-arm64" "otp-${version}-linux-arm64"
# Upload binaries with descriptive names from build directory
upload_release_asset "$api_url" "$token" "$version" "build/otp-x86_64" "otp-${version}-linux-x86_64"
upload_release_asset "$api_url" "$token" "$version" "build/otp-arm64" "otp-${version}-linux-arm64"
else
print_warning "Release may already exist or creation failed"
print_status "Response: $response"
# Try to upload to existing release anyway
upload_release_asset "$api_url" "$token" "$version" "otp-x86_64" "otp-${version}-linux-x86_64"
upload_release_asset "$api_url" "$token" "$version" "otp-arm64" "otp-${version}-linux-arm64"
upload_release_asset "$api_url" "$token" "$version" "build/otp-x86_64" "otp-${version}-linux-x86_64"
upload_release_asset "$api_url" "$token" "$version" "build/otp-arm64" "otp-${version}-linux-arm64"
fi
}
@@ -259,9 +259,8 @@ build_project() {
# Build x86_64 only
print_status "Building OTP project for x86_64..."
make CC=gcc
make CC=gcc ARCH=x86_64
if [ $? -eq 0 ]; then
mv otp otp-x86_64
print_success "x86_64 build completed successfully"
else
print_error "x86_64 build failed"
@@ -271,9 +270,8 @@ build_project() {
# Build both architectures
print_status "Building OTP project for x86_64..."
make clean
make CC=gcc
make CC=gcc ARCH=x86_64
if [ $? -eq 0 ]; then
mv otp otp-x86_64
print_success "x86_64 build completed successfully"
else
print_error "x86_64 build failed"
@@ -282,9 +280,8 @@ build_project() {
print_status "Building OTP project for ARM64/AArch64..."
make clean
make CC=aarch64-linux-gnu-gcc
make CC=aarch64-linux-gnu-gcc ARCH=arm64
if [ $? -eq 0 ]; then
mv otp otp-arm64
print_success "ARM64/AArch64 build completed successfully"
else
print_error "ARM64/AArch64 build failed"
@@ -306,8 +303,8 @@ build_project() {
clean_project() {
print_status "Cleaning build artifacts..."
make clean
# Remove cross-compiled binaries
rm -f otp-x86_64 otp-arm64
# Remove build directory
rm -rf build
print_success "Clean completed"
}
@@ -362,8 +359,8 @@ case "$COMMAND" in
echo " uninstall - Remove from system"
echo ""
echo "Build Output:"
echo " otp-x86_64 - Native x86_64 binary"
echo " otp-arm64 - ARM64/AArch64 binary for Raspberry Pi (if cross-compiler available)"
echo " build/otp-x86_64 - Native x86_64 binary"
echo " build/otp-arm64 - ARM64/AArch64 binary for Raspberry Pi (if cross-compiler available)"
echo ""
echo "Gitea Integration:"
echo " - Automatically creates releases with binaries if ~/.gitea_token exists"