6 Commits

Author SHA1 Message Date
2067caf253 Modify bb64/src/bb64.cpp
All checks were successful
Build-Test-Publish / build (linux/amd64) (push) Successful in 1m18s
Build-Test-Publish / build (linux/arm64) (push) Successful in 2m15s
Build-Test-Publish / test-install-from-scratch (linux/amd64) (push) Successful in 8s
Build-Test-Publish / test-install-from-scratch (linux/arm64) (push) Successful in 8s
2025-06-26 21:09:06 +12:00
4d500cbddd Update 2 files
All checks were successful
Build-Test-Publish / build (linux/amd64) (push) Successful in 1m19s
Build-Test-Publish / build (linux/arm64) (push) Successful in 2m14s
Build-Test-Publish / test-install-from-scratch (linux/amd64) (push) Successful in 7s
Build-Test-Publish / test-install-from-scratch (linux/arm64) (push) Successful in 8s
2025-06-25 22:47:45 +12:00
884609f661 Modify buildtestpublish_all.sh
Some checks failed
Build-Test-Publish / build (linux/amd64) (push) Successful in 1m19s
Build-Test-Publish / build (linux/arm64) (push) Failing after 2m14s
Build-Test-Publish / test-install-from-scratch (linux/amd64) (push) Has been skipped
Build-Test-Publish / test-install-from-scratch (linux/arm64) (push) Has been skipped
2025-06-25 22:42:52 +12:00
a5a36c179b Modify dehydrate/test/build_dehydrate_test.sh
Some checks failed
Build-Test-Publish / build (linux/amd64) (push) Failing after 1m17s
Build-Test-Publish / build (linux/arm64) (push) Successful in 2m15s
Build-Test-Publish / test-install-from-scratch (linux/amd64) (push) Has been skipped
Build-Test-Publish / test-install-from-scratch (linux/arm64) (push) Has been skipped
2025-06-25 22:41:01 +12:00
42b51ef0be test: Update 2 files
Some checks failed
Build-Test-Publish / build (linux/amd64) (push) Failing after 1m8s
Build-Test-Publish / build (linux/arm64) (push) Failing after 1m57s
Build-Test-Publish / test-install-from-scratch (linux/amd64) (push) Has been skipped
Build-Test-Publish / test-install-from-scratch (linux/arm64) (push) Has been skipped
2025-06-25 22:38:12 +12:00
f094d532cf Modify buildtestpublish_all.sh
Some checks failed
Build-Test-Publish / build (linux/amd64) (push) Failing after 1m27s
Build-Test-Publish / build (linux/arm64) (push) Failing after 2m41s
Build-Test-Publish / test-install-from-scratch (linux/amd64) (push) Has been skipped
Build-Test-Publish / test-install-from-scratch (linux/arm64) (push) Has been skipped
2025-06-25 22:33:09 +12:00
5 changed files with 123 additions and 69 deletions

View File

@ -77,40 +77,60 @@ if ! git config user.email >/dev/null 2>&1; then
git config user.name "CI Bot" git config user.name "CI Bot"
fi fi
# Check if tag already exists # Check if tag already exists locally
if git rev-parse "$TAG" >/dev/null 2>&1; then if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "Tag $TAG already exists, deleting it first..." echo "Tag $TAG already exists locally, deleting it first..."
git tag -d "$TAG" git tag -d "$TAG"
git push origin --delete "$TAG" || true
fi fi
git tag -a "$TAG" -m "Release $TAG" # Check if tag exists on remote
if ! git push origin "$TAG"; then if git ls-remote --tags origin | grep -q "refs/tags/$TAG"; then
echo "Failed to push tag $TAG to origin" >&2 echo "Tag $TAG already exists on remote - this is expected for multi-architecture builds"
# Try to delete local tag if push failed echo "Skipping tag creation and proceeding with release attachment..."
git tag -d "$TAG" else
exit 1 echo "Creating new tag $TAG..."
git tag -a "$TAG" -m "Release $TAG"
if ! git push origin "$TAG"; then
echo "Failed to push tag $TAG to origin" >&2
# Try to delete local tag if push failed
git tag -d "$TAG"
exit 1
fi
echo "Successfully created and pushed tag $TAG"
fi fi
echo "Creating release $TAG on Gitea..." echo "Getting or creating release $TAG on Gitea..."
RELEASE_RESPONSE=$(curl -s -X POST "$API_URL/releases" \
-H "Content-Type: application/json" \
-H "Authorization: token $RELEASE_WRITE_TOKEN" \
-d "$RELEASE_DATA")
echo "Release API response: $RELEASE_RESPONSE" # First try to get existing release
EXISTING_RELEASE=$(curl -s -X GET "$API_URL/releases/tags/$TAG" \
-H "Authorization: token $RELEASE_WRITE_TOKEN")
RELEASE_ID=$(echo "$RELEASE_RESPONSE" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2) if echo "$EXISTING_RELEASE" | grep -q '"id":[0-9]*'; then
# Release already exists, get its ID
RELEASE_ID=$(echo "$EXISTING_RELEASE" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
echo "Release $TAG already exists with ID: $RELEASE_ID"
else
# Create new release
echo "Creating new release $TAG on Gitea..."
RELEASE_RESPONSE=$(curl -s -X POST "$API_URL/releases" \
-H "Content-Type: application/json" \
-H "Authorization: token $RELEASE_WRITE_TOKEN" \
-d "$RELEASE_DATA")
if [ -z "$RELEASE_ID" ]; then echo "Release API response: $RELEASE_RESPONSE"
echo "Failed to create release on Gitea." >&2
echo "API URL: $API_URL/releases" >&2 RELEASE_ID=$(echo "$RELEASE_RESPONSE" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
echo "Release data: $RELEASE_DATA" >&2
exit 1 if [ -z "$RELEASE_ID" ]; then
echo "Failed to create release on Gitea." >&2
echo "API URL: $API_URL/releases" >&2
echo "Release data: $RELEASE_DATA" >&2
exit 1
fi
echo "Created new release with ID: $RELEASE_ID"
fi fi
echo "Created release with ID: $RELEASE_ID"
# Upload binaries and install.sh # Upload binaries and install.sh
echo "Uploading assets to release..." echo "Uploading assets to release..."
for FILE in ${PROJECT}.${ARCH_ALIAS} ${PROJECT}.${ARCH} install.sh; do for FILE in ${PROJECT}.${ARCH_ALIAS} ${PROJECT}.${ARCH} install.sh; do

View File

@ -161,7 +161,7 @@ Usage:
{ {
if (mode == "-u") if (mode == "-u")
return update_bb64(); return update_bb64();
else if (mode == "-v") else if (mode == "-v" || mode == "version")
{ {
std::cout << VERSION << std::endl; std::cout << VERSION << std::endl;
return 0; return 0;

View File

@ -2,6 +2,9 @@
set -uo pipefail # Remove -e to handle errors manually set -uo pipefail # Remove -e to handle errors manually
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
docker builder prune -f
# Colors for output # Colors for output
RED='\033[0;31m' RED='\033[0;31m'
GREEN='\033[0;32m' GREEN='\033[0;32m'
@ -112,13 +115,35 @@ function buildtestpublish() {
cd "$dir" || echo "Failed to cd to $dir" cd "$dir" || echo "Failed to cd to $dir"
subtitle "🔨 BUILDING $TOOLNAME_UPPER 🔨" subtitle "🔨 BUILDING $TOOLNAME_UPPER 🔨"
dothis build "$dir" "$TOOLNAME" if dothis build "$dir" "$TOOLNAME"; then
BUILD_SUCCESS=true
else
BUILD_SUCCESS=false
fi
subtitle "🔍 TESTING $TOOLNAME_UPPER 🔍" subtitle "🔍 TESTING $TOOLNAME_UPPER 🔍"
dothis test "$dir" "$TOOLNAME" if [ "$BUILD_SUCCESS" = true ]; then
if dothis test "$dir" "$TOOLNAME"; then
TEST_SUCCESS=true
else
TEST_SUCCESS=false
fi
else
echo "Skipping tests - build failed"
TEST_RESULTS["$TOOLNAME"]="SKIP"
TEST_SUCCESS=false
fi
subtitle "📦 PUBLISHING $TOOLNAME_UPPER 📦" subtitle "📦 PUBLISHING $TOOLNAME_UPPER 📦"
dothis publish "$dir" "$TOOLNAME" if [ "$BUILD_SUCCESS" = true ] && [ "$TEST_SUCCESS" = true ]; then
dothis publish "$dir" "$TOOLNAME"
elif [ "$BUILD_SUCCESS" = true ] && [ "${TEST_RESULTS[$TOOLNAME]}" = "SKIP" ]; then
# If tests are skipped (no test script), allow publish if build succeeded
dothis publish "$dir" "$TOOLNAME"
else
echo "Skipping publish - build or tests failed"
PUBLISH_RESULTS["$TOOLNAME"]="SKIP"
fi
echo "Done" echo "Done"
} }
@ -177,25 +202,25 @@ function print_summary() {
# Format build status with colors # Format build status with colors
case "$build_status" in case "$build_status" in
"✓") build_col=$(printf " ${GREEN}${NC} ") ;; "✓") build_col=$(printf " %s✓%s " "$GREEN" "$NC") ;;
"✗") build_col=$(printf " ${RED}${NC} ") ;; "✗") build_col=$(printf " %s✗%s " "$RED" "$NC") ;;
"SKIP") build_col=$(printf " ${YELLOW}-${NC} ") ;; "SKIP") build_col=$(printf " %s-%s " "$YELLOW" "$NC") ;;
*) build_col=" - " ;; *) build_col=" - " ;;
esac esac
# Format test status with colors # Format test status with colors
case "$test_status" in case "$test_status" in
"✓") test_col=$(printf " ${GREEN}${NC} ") ;; "✓") test_col=$(printf " %s✓%s " "$GREEN" "$NC") ;;
"✗") test_col=$(printf " ${RED}${NC} ") ;; "✗") test_col=$(printf " %s✗%s " "$RED" "$NC") ;;
"SKIP") test_col=$(printf " ${YELLOW}-${NC} ") ;; "SKIP") test_col=$(printf " %s-%s " "$YELLOW" "$NC") ;;
*) test_col=" - " ;; *) test_col=" - " ;;
esac esac
# Format publish status with colors # Format publish status with colors
case "$publish_status" in case "$publish_status" in
"✓") publish_col=$(printf " ${GREEN}${NC} ") ;; "✓") publish_col=$(printf " %s✓%s " "$GREEN" "$NC") ;;
"✗") publish_col=$(printf " ${RED}${NC} ") ;; "✗") publish_col=$(printf " %s✗%s " "$RED" "$NC") ;;
"SKIP") publish_col=$(printf " ${YELLOW}-${NC} ") ;; "SKIP") publish_col=$(printf " %s-%s " "$YELLOW" "$NC") ;;
*) publish_col=" - " ;; *) publish_col=" - " ;;
esac esac

View File

@ -16,39 +16,48 @@ rm -f dehydrate_test
# Build the test program using Docker # Build the test program using Docker
# The Docker container supports both amd64 and arm64 architectures # The Docker container supports both amd64 and arm64 architectures
docker run --rm \ echo "Building dehydrate test executable..."
-v "$PROJECT_DIR":/workdir \
-w /workdir/test \ # Use docker cp approach since volume mounting may not work in CI
CONTAINER_NAME="dehydrate-test-build-$$"
# Start container in detached mode
docker run -d --name "$CONTAINER_NAME" \
gitea.jde.nz/public/dropshell-build-base:latest \ gitea.jde.nz/public/dropshell-build-base:latest \
bash -c " sleep 60
# Verify we can find the source file
if [ ! -f dehydrate_test.cpp ]; then # Copy source file into container
echo 'ERROR: dehydrate_test.cpp not found in current directory' docker cp dehydrate_test.cpp "$CONTAINER_NAME":/dehydrate_test.cpp
echo 'Working directory:' && pwd
echo 'Available files:' && ls -la # Compile in container
exit 1 docker exec "$CONTAINER_NAME" bash -c "
fi echo 'Compiling dehydrate test...'
if ! g++ -std=c++23 -static /dehydrate_test.cpp -o /dehydrate_test; then
# Clean any existing binary and compile echo 'ERROR: Compilation failed'
rm -f dehydrate_test exit 1
if ! g++ -std=c++23 -static dehydrate_test.cpp -o dehydrate_test; then fi
echo 'ERROR: Compilation failed'
exit 1 # Verify binary was created
fi if [ ! -f /dehydrate_test ]; then
echo 'ERROR: Binary was not created'
# Verify binary was created and is executable exit 1
if [ ! -f dehydrate_test ]; then fi
echo 'ERROR: Binary was not created'
exit 1 # Quick architecture check
fi if ! file /dehydrate_test | grep -q 'executable'; then
echo 'ERROR: Generated file is not an executable'
# Quick architecture check - just verify the binary format file /dehydrate_test
if ! file dehydrate_test | grep -q 'executable'; then exit 1
echo 'ERROR: Generated file is not an executable' fi
file dehydrate_test
exit 1 echo 'Compilation successful'
fi "
"
# Copy binary back to host
docker cp "$CONTAINER_NAME":/dehydrate_test ./dehydrate_test
# Clean up container
docker rm -f "$CONTAINER_NAME"
# Check if compilation succeeded # Check if compilation succeeded
if [ ! -f "./dehydrate_test" ]; then if [ ! -f "./dehydrate_test" ]; then

2
gp/gp
View File

@ -350,7 +350,7 @@ case "${1:-}" in
exit 0 exit 0
;; ;;
version) version)
echo "gp version 2.0.0" echo "2.0.1"
exit 0 exit 0
;; ;;
esac esac