Skip to content

Commit 91c82a3

Browse files
committed
Refactor build scripts to eliminate discrepancies
- Modified build-*.sh scripts to reuse directories from prepare-*.sh - Build scripts now only create ZIP files and checksums - Eliminates discrepancies between ForgeBox and GitHub artifacts - Fixes workflow bugs calling wrong script for starter app - Significantly reduces build time and maintenance overhead Changes: - build-base.sh: Reuse prepared directory instead of rebuilding - build-core.sh: Reuse prepared directory instead of rebuilding - build-cli.sh: Reuse prepared directory instead of rebuilding - build-starterApp.sh: Reuse prepared directory instead of rebuilding - release.yml: Fix line 189 to call build-starterApp.sh - release-candidate.yml: Fix line 177 to call build-starterApp.sh
1 parent cffd252 commit 91c82a3

File tree

7 files changed

+48
-168
lines changed

7 files changed

+48
-168
lines changed

.github/workflows/release-candidate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ jobs:
174174
./tools/build/scripts/build-base.sh "${{ env.WHEELS_VERSION }}" "${{ env.BRANCH }}" "${{ github.run_number }}" "${{ env.WHEELS_PRERELEASE }}"
175175
./tools/build/scripts/build-core.sh "${{ env.WHEELS_VERSION }}" "${{ env.BRANCH }}" "${{ github.run_number }}" "${{ env.WHEELS_PRERELEASE }}"
176176
./tools/build/scripts/build-cli.sh "${{ env.WHEELS_VERSION }}" "${{ env.BRANCH }}" "${{ github.run_number }}" "${{ env.WHEELS_PRERELEASE }}"
177-
./tools/build/scripts/build-cli.sh "${{ env.WHEELS_VERSION }}"
177+
./tools/build/scripts/build-starterApp.sh "${{ env.WHEELS_VERSION }}"
178178
179179
- name: Upload Wheels Base Template Artifact
180180
uses: actions/upload-artifact@v4

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ jobs:
186186
./tools/build/scripts/build-base.sh "${{ env.WHEELS_VERSION }}" "${{ env.BRANCH }}" "${{ github.run_number }}" "${{ env.WHEELS_PRERELEASE }}"
187187
./tools/build/scripts/build-core.sh "${{ env.WHEELS_VERSION }}" "${{ env.BRANCH }}" "${{ github.run_number }}" "${{ env.WHEELS_PRERELEASE }}"
188188
./tools/build/scripts/build-cli.sh "${{ env.WHEELS_VERSION }}" "${{ env.BRANCH }}" "${{ github.run_number }}" "${{ env.WHEELS_PRERELEASE }}"
189-
./tools/build/scripts/build-cli.sh "${{ env.WHEELS_VERSION }}"
189+
./tools/build/scripts/build-starterApp.sh "${{ env.WHEELS_VERSION }}"
190190
191191
- name: Upload Wheels Base Template Artifact
192192
uses: actions/upload-artifact@v4

cli/src/commands/wheels/generate/app-wizard.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ component aliases="wheels g app-wizard, wheels new" extends="../base" {
152152

153153
var template = multiselect( 'Which Wheels Template shall we use? ' )
154154
.options( [
155-
{value: 'wheels-base-template@BE', display: '3.0.x - Wheels Base Template - Bleeding Edge', selected: true},
155+
{value: 'wheels-base-template@^3.0.0-rc.1', display: '3.0.0-rc - Wheels Base Template - Release Candidate', selected: true},
156156
{value: 'cfwheels-base-template', display: '2.5.x - Wheels Base Template - Stable Release'},
157157
{value: 'cfwheels-template-htmx-alpine-simple', display: 'Wheels Template - HTMX - Alpine.js - Simple.css'},
158158
{value: 'wheels-starter-app', display: 'Wheels Starter App'},

tools/build/scripts/build-base.sh

Lines changed: 11 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -2,86 +2,34 @@
22
set -e
33

44
# Build script for Wheels Base Template
5+
# This script creates GitHub artifacts (ZIP files) from the directory prepared by prepare-base.sh
56
# Usage: ./build-base.sh <version> <branch> <build_number> <is_prerelease>
67

78
VERSION=$1
89
BRANCH=$2
910
BUILD_NUMBER=$3
1011
IS_PRERELEASE=$4
1112

12-
echo "Building Wheels Base Template v${VERSION}"
13+
echo "Building Wheels Base Template v${VERSION} artifacts from prepared directory"
1314

1415
# Setup directories
1516
BUILD_DIR="build-wheels-base"
1617
EXPORT_DIR="artifacts/wheels/${VERSION}"
1718
BE_EXPORT_DIR="artifacts/wheels"
1819

19-
# Cleanup and create directories
20-
rm -rf "${BUILD_DIR}"
21-
mkdir -p "${BUILD_DIR}"
22-
mkdir -p "${EXPORT_DIR}"
23-
mkdir -p "${BE_EXPORT_DIR}"
24-
25-
# Create build label file
26-
BUILD_LABEL="wheels-base-template-${VERSION}-$(date +%Y%m%d%H%M%S)"
27-
echo "Built on $(date)" > "${BUILD_DIR}/${BUILD_LABEL}"
28-
29-
# Copy base template files
30-
echo "Copying base template files..."
31-
cp -r templates/base/src/app "${BUILD_DIR}/"
32-
cp -r templates/base/src/config "${BUILD_DIR}/"
33-
cp -r templates/base/src/public "${BUILD_DIR}/"
34-
cp -r tests "${BUILD_DIR}/"
35-
36-
# Copy AI documentation files
37-
echo "Copying AI documentation..."
38-
cp CLAUDE.md "${BUILD_DIR}/"
39-
cp -r .ai "${BUILD_DIR}/"
40-
41-
# Copy VS Code snippets
42-
echo "Copying VS Code snippets..."
43-
mkdir -p "${BUILD_DIR}/.vscode"
44-
cp .vscode/wheels.code-snippets "${BUILD_DIR}/.vscode/"
45-
cp .vscode/wheels-test.code-snippets "${BUILD_DIR}/.vscode/"
46-
47-
# Copy vendor directory from tools/build/base if it exists
48-
if [ -d "tools/build/base/vendor" ]; then
49-
cp -r tools/build/base/vendor "${BUILD_DIR}/"
20+
# Verify that prepare-base.sh has been run
21+
if [ ! -d "${BUILD_DIR}" ]; then
22+
echo "ERROR: ${BUILD_DIR} does not exist!"
23+
echo "Please run prepare-base.sh first to create the build directory."
24+
exit 1
5025
fi
5126

52-
# Copy template files, overwriting defaults
53-
cp tools/build/base/box.json "${BUILD_DIR}/box.json"
54-
cp tools/build/base/README.md "${BUILD_DIR}/README.md"
55-
cp tools/build/base/server.json "${BUILD_DIR}/server.json"
56-
cp tools/build/base/config/app.cfm "${BUILD_DIR}/config/app.cfm"
57-
cp tools/build/base/config/settings.cfm "${BUILD_DIR}/config/settings.cfm"
58-
59-
# Replace version placeholders
60-
echo "Replacing version placeholders..."
61-
find "${BUILD_DIR}" -type f -name "*.json" -o -name "*.md" -o -name "*.cfm" -o -name "*.cfc" | while read file; do
62-
sed -i.bak "s/@build\.version@/${VERSION}/g" "$file" && rm "${file}.bak"
63-
done
64-
65-
# Handle build number based on release type
66-
if [ "${IS_PRERELEASE}" = "true" ]; then
67-
# PreRelease: use build number as-is
68-
find "${BUILD_DIR}" -type f -name "*.json" -o -name "*.md" -o -name "*.cfm" -o -name "*.cfc" | while read file; do
69-
sed -i.bak "s/@build\.number@/${BUILD_NUMBER}/g" "$file" && rm "${file}.bak"
70-
done
71-
elif [ "${BRANCH}" = "develop" ]; then
72-
# Snapshot: replace +@build.number@ with -snapshot
73-
find "${BUILD_DIR}" -type f -name "*.json" -o -name "*.md" -o -name "*.cfm" -o -name "*.cfc" | while read file; do
74-
sed -i.bak "s/+@build\.number@/-snapshot/g" "$file" && rm "${file}.bak"
75-
done
76-
else
77-
# Regular release: use build number as-is
78-
find "${BUILD_DIR}" -type f -name "*.json" -o -name "*.md" -o -name "*.cfm" -o -name "*.cfc" | while read file; do
79-
sed -i.bak "s/@build\.number@/${BUILD_NUMBER}/g" "$file" && rm "${file}.bak"
80-
done
81-
fi
27+
# Create export directories
28+
mkdir -p "${EXPORT_DIR}"
29+
mkdir -p "${BE_EXPORT_DIR}"
8230

8331
# Create ZIP file
84-
echo "Creating ZIP package..."
32+
echo "Creating ZIP package from prepared directory..."
8533
cd "${BUILD_DIR}" && zip -r "../${EXPORT_DIR}/wheels-base-template-${VERSION}.zip" ./ && cd ..
8634

8735
# Generate checksums

tools/build/scripts/build-cli.sh

Lines changed: 11 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,64 +2,34 @@
22
set -e
33

44
# Build script for Wheels CLI
5+
# This script creates GitHub artifacts (ZIP files) from the directory prepared by prepare-cli.sh
56
# Usage: ./build-cli.sh <version> <branch> <build_number> <is_prerelease>
67

78
VERSION=$1
89
BRANCH=$2
910
BUILD_NUMBER=$3
1011
IS_PRERELEASE=$4
1112

12-
echo "Building Wheels CLI v${VERSION}"
13+
echo "Building Wheels CLI v${VERSION} artifacts from prepared directory"
1314

1415
# Setup directories
1516
BUILD_DIR="build-wheels-cli"
1617
EXPORT_DIR="artifacts/wheels/${VERSION}"
1718
BE_EXPORT_DIR="artifacts/wheels"
1819

19-
# Cleanup and create directories
20-
rm -rf "${BUILD_DIR}"
21-
mkdir -p "${BUILD_DIR}/wheels-cli"
20+
# Verify that prepare-cli.sh has been run
21+
if [ ! -d "${BUILD_DIR}/wheels-cli" ]; then
22+
echo "ERROR: ${BUILD_DIR}/wheels-cli does not exist!"
23+
echo "Please run prepare-cli.sh first to create the build directory."
24+
exit 1
25+
fi
26+
27+
# Create export directories
2228
mkdir -p "${EXPORT_DIR}"
2329
mkdir -p "${BE_EXPORT_DIR}"
2430

25-
# Create build label file
26-
BUILD_LABEL="wheels-cli-${VERSION}-$(date +%Y%m%d%H%M%S)"
27-
echo "Built on $(date)" > "${BUILD_DIR}/wheels-cli/${BUILD_LABEL}"
28-
29-
# Copy CLI files, excluding specific directories and files
30-
echo "Copying CLI files..."
31-
rsync -av --exclude='workspace' --exclude='simpletestapp' --exclude='*.log' --exclude='.git' --exclude='.gitignore' cli/src/ "${BUILD_DIR}/wheels-cli/"
32-
33-
# Copy template files
34-
cp tools/build/cli/box.json "${BUILD_DIR}/wheels-cli/box.json"
35-
cp tools/build/cli/README.md "${BUILD_DIR}/wheels-cli/README.md"
36-
37-
# Replace version placeholders
38-
echo "Replacing version placeholders..."
39-
find "${BUILD_DIR}/wheels-cli" -type f -name "*.json" -o -name "*.md" -o -name "*.cfm" -o -name "*.cfc" | while read file; do
40-
sed -i.bak "s/@build\.version@/${VERSION}/g" "$file" && rm "${file}.bak"
41-
done
42-
43-
# Handle build number based on release type
44-
if [ "${IS_PRERELEASE}" = "true" ]; then
45-
# PreRelease: use build number as-is
46-
find "${BUILD_DIR}/wheels-cli" -type f -name "*.json" -o -name "*.md" -o -name "*.cfm" -o -name "*.cfc" | while read file; do
47-
sed -i.bak "s/@build\.number@/${BUILD_NUMBER}/g" "$file" && rm "${file}.bak"
48-
done
49-
elif [ "${BRANCH}" = "develop" ]; then
50-
# Snapshot: replace +@build.number@ with -snapshot
51-
find "${BUILD_DIR}/wheels-cli" -type f -name "*.json" -o -name "*.md" -o -name "*.cfm" -o -name "*.cfc" | while read file; do
52-
sed -i.bak "s/+@build\.number@/-snapshot/g" "$file" && rm "${file}.bak"
53-
done
54-
else
55-
# Regular release: use build number as-is
56-
find "${BUILD_DIR}/wheels-cli" -type f -name "*.json" -o -name "*.md" -o -name "*.cfm" -o -name "*.cfc" | while read file; do
57-
sed -i.bak "s/@build\.number@/${BUILD_NUMBER}/g" "$file" && rm "${file}.bak"
58-
done
59-
fi
60-
6131
# Create ZIP file
62-
echo "Creating ZIP package..."
32+
echo "Creating ZIP package from prepared directory..."
6333
cd "${BUILD_DIR}" && zip -r "../${EXPORT_DIR}/wheels-cli-${VERSION}.zip" wheels-cli/ && cd ..
6434

6535
# Generate checksums

tools/build/scripts/build-core.sh

Lines changed: 11 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2,70 +2,34 @@
22
set -e
33

44
# Build script for Wheels Core
5+
# This script creates GitHub artifacts (ZIP files) from the directory prepared by prepare-core.sh
56
# Usage: ./build-core.sh <version> <branch> <build_number> <is_prerelease>
67

78
VERSION=$1
89
BRANCH=$2
910
BUILD_NUMBER=$3
1011
IS_PRERELEASE=$4
1112

12-
echo "Building Wheels Core v${VERSION}"
13+
echo "Building Wheels Core v${VERSION} artifacts from prepared directory"
1314

1415
# Setup directories
1516
BUILD_DIR="build-wheels-core"
1617
EXPORT_DIR="artifacts/wheels/${VERSION}"
1718
BE_EXPORT_DIR="artifacts/wheels"
1819

19-
# Cleanup and create directories
20-
rm -rf "${BUILD_DIR}"
21-
mkdir -p "${BUILD_DIR}/wheels"
20+
# Verify that prepare-core.sh has been run
21+
if [ ! -d "${BUILD_DIR}/wheels" ]; then
22+
echo "ERROR: ${BUILD_DIR}/wheels does not exist!"
23+
echo "Please run prepare-core.sh first to create the build directory."
24+
exit 1
25+
fi
26+
27+
# Create export directories
2228
mkdir -p "${EXPORT_DIR}"
2329
mkdir -p "${BE_EXPORT_DIR}"
2430

25-
# Create build label file
26-
BUILD_LABEL="wheels-core-${VERSION}-$(date +%Y%m%d%H%M%S)"
27-
echo "Built on $(date)" > "${BUILD_DIR}/wheels/${BUILD_LABEL}"
28-
29-
# Copy core files
30-
echo "Copying core files..."
31-
cp -r core/src/wheels/* "${BUILD_DIR}/wheels/"
32-
33-
# Copy docs
34-
echo "Copying docs..."
35-
rm -rf "${BUILD_DIR}/wheels/docs"
36-
mkdir -p "${BUILD_DIR}/wheels/docs"
37-
cp -r docs/* "${BUILD_DIR}/wheels/docs/"
38-
39-
# Copy template files
40-
cp tools/build/core/box.json "${BUILD_DIR}/wheels/box.json"
41-
cp tools/build/core/README.md "${BUILD_DIR}/wheels/README.md"
42-
43-
# Replace version placeholders
44-
echo "Replacing version placeholders..."
45-
find "${BUILD_DIR}/wheels" -type f -name "*.json" -o -name "*.md" -o -name "*.cfm" -o -name "*.cfc" | while read file; do
46-
sed -i.bak "s/@build\.version@/${VERSION}/g" "$file" && rm "${file}.bak"
47-
done
48-
49-
# Handle build number based on release type
50-
if [ "${IS_PRERELEASE}" = "true" ]; then
51-
# PreRelease: use build number as-is
52-
find "${BUILD_DIR}/wheels" -type f -name "*.json" -o -name "*.md" -o -name "*.cfm" -o -name "*.cfc" | while read file; do
53-
sed -i.bak "s/@build\.number@/${BUILD_NUMBER}/g" "$file" && rm "${file}.bak"
54-
done
55-
elif [ "${BRANCH}" = "develop" ]; then
56-
# Snapshot: replace +@build.number@ with -snapshot
57-
find "${BUILD_DIR}/wheels" -type f -name "*.json" -o -name "*.md" -o -name "*.cfm" -o -name "*.cfc" | while read file; do
58-
sed -i.bak "s/+@build\.number@/-snapshot/g" "$file" && rm "${file}.bak"
59-
done
60-
else
61-
# Regular release: use build number as-is
62-
find "${BUILD_DIR}/wheels" -type f -name "*.json" -o -name "*.md" -o -name "*.cfm" -o -name "*.cfc" | while read file; do
63-
sed -i.bak "s/@build\.number@/${BUILD_NUMBER}/g" "$file" && rm "${file}.bak"
64-
done
65-
fi
66-
6731
# Create ZIP file
68-
echo "Creating ZIP package..."
32+
echo "Creating ZIP package from prepared directory..."
6933
cd "${BUILD_DIR}" && zip -r "../${EXPORT_DIR}/wheels-core-${VERSION}.zip" wheels/ && cd ..
7034

7135
# Generate checksums

tools/build/scripts/build-starterApp.sh

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,31 @@
22
set -e
33

44
# Build script for Wheels Starter App
5-
# Usage: ./build-base.sh <version> <branch> <build_number> <is_prerelease>
5+
# This script creates GitHub artifacts (ZIP files) from the directory prepared by prepare-starterApp.sh
6+
# Usage: ./build-starterApp.sh <version>
67

78
VERSION=$1
89

9-
echo "Building Wheels Starter App v${VERSION}"
10+
echo "Building Wheels Starter App v${VERSION} artifacts from prepared directory"
1011

1112
# Setup directories
1213
BUILD_DIR="build-wheels-starterApp"
1314
EXPORT_DIR="artifacts/wheels/${VERSION}"
1415
BE_EXPORT_DIR="artifacts/wheels"
1516

16-
# Cleanup and create directories
17-
rm -rf "${BUILD_DIR}"
18-
mkdir -p "${BUILD_DIR}"
17+
# Verify that prepare-starterApp.sh has been run
18+
if [ ! -d "${BUILD_DIR}" ]; then
19+
echo "ERROR: ${BUILD_DIR} does not exist!"
20+
echo "Please run prepare-starterApp.sh first to create the build directory."
21+
exit 1
22+
fi
23+
24+
# Create export directories
1925
mkdir -p "${EXPORT_DIR}"
2026
mkdir -p "${BE_EXPORT_DIR}"
2127

22-
# Create build label file
23-
BUILD_LABEL="wheels-starter-app-${VERSION}-$(date +%Y%m%d%H%M%S)"
24-
echo "Built on $(date)" > "${BUILD_DIR}/${BUILD_LABEL}"
25-
26-
# Copy Starter App files
27-
echo "Copying Starter App files..."
28-
cp -r examples/starter-app/* "${BUILD_DIR}/"
29-
3028
# Create ZIP file
31-
echo "Creating ZIP package..."
29+
echo "Creating ZIP package from prepared directory..."
3230
cd "${BUILD_DIR}" && zip -r "../${EXPORT_DIR}/wheels-starter-app-${VERSION}.zip" ./ && cd ..
3331

3432
# Generate checksums

0 commit comments

Comments
 (0)