Skip to content

Commit 8b8936b

Browse files
committed
Fix: Add UTF-8 BOM and fix Blazor WASM deployment
- Add UTF-8 BOM to markdown files with emojis - Fix GitHub Pages deployment for _framework directory - Fix base href for custom domain - Remove unused monitor-certificate.ps1
1 parent 34fd56d commit 8b8936b

File tree

6 files changed

+53
-207
lines changed

6 files changed

+53
-207
lines changed

.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SchemaMagic - Interactive Entity Framework Core Schema Visualizer
1+
# SchemaMagic - Interactive Entity Framework Core Schema Visualizer
22

33
## Project Overview
44

.github/workflows/ci-cd.yml

Lines changed: 21 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ jobs:
161161
id: nbgv
162162
run: |
163163
VERSION=$(nbgv get-version -v SimpleVersion)
164+
FULL_VERSION=$(nbgv get-version -v SemVer2)
164165
echo "version=$VERSION" >> $GITHUB_OUTPUT
166+
echo "fullVersion=$FULL_VERSION" >> $GITHUB_OUTPUT
165167
echo "[INFO] Web App Version: $VERSION"
166168
167169
- name: Setup Pages
@@ -171,64 +173,36 @@ jobs:
171173
run: dotnet restore SchemaMagic.Web/SchemaMagic.Web.csproj
172174

173175
- name: Publish
174-
run: dotnet publish SchemaMagic.Web/SchemaMagic.Web.csproj --configuration Release --output dist/
176+
run: dotnet publish SchemaMagic.Web/SchemaMagic.Web.csproj --configuration Release --output publish/
175177

176178
- name: List published files
177179
run: |
178180
echo "[INFO] Listing published files..."
179-
ls -la dist/
181+
ls -la publish/
180182
echo "[INFO] Checking for wwwroot..."
181-
if [ -d "dist/wwwroot" ]; then
183+
if [ -d "publish/wwwroot" ]; then
182184
echo "[INFO] wwwroot exists, listing contents..."
183-
ls -la dist/wwwroot/
184-
echo "[INFO] Looking for index.html in wwwroot..."
185-
find dist/wwwroot -name "index.html" -type f || echo "[INFO] No index.html found in wwwroot"
185+
ls -la publish/wwwroot/ | head -20
186+
echo "[INFO] Checking for _framework..."
187+
ls -la publish/wwwroot/_framework/ | head -10 || echo "[INFO] No _framework in wwwroot"
186188
else
187189
echo "[INFO] No wwwroot directory found"
190+
echo "[INFO] Checking for _framework in publish root..."
191+
ls -la publish/_framework/ | head -10 || echo "[INFO] No _framework in publish root"
188192
fi
189-
echo "[INFO] Searching for ALL index.html files in dist/..."
190-
find dist/ -name "index.html" -type f || echo "[INFO] No index.html found anywhere in dist/"
191-
echo "[INFO] Listing ALL files in dist/ recursively (first 50)..."
192-
find dist/ -type f | head -50
193+
echo "[INFO] Searching for index.html..."
194+
find publish/ -name "index.html" -type f
193195
194-
- name: Fix base path for GitHub Pages
196+
- name: Configure for GitHub Pages
195197
run: |
196-
echo "[INFO] Configuring for GitHub Pages..."
198+
echo "[INFO] Configuring for GitHub Pages with custom domain (schema.magicsuite.net)..."
197199
198-
# Check if index.html is in wwwroot subdirectory
199-
if [ -f "dist/wwwroot/index.html" ]; then
200-
echo "[INFO] Found index.html in dist/wwwroot/"
201-
sed -i 's|<base href="/" />|<base href="/SchemaMagic/" />|g' dist/wwwroot/index.html
202-
touch dist/wwwroot/.nojekyll
203-
cp dist/wwwroot/index.html dist/wwwroot/404.html
204-
echo "${{ steps.nbgv.outputs.version }}" > dist/wwwroot/version.txt
205-
elif [ -f "dist/index.html" ]; then
206-
echo "[INFO] Found index.html in dist/"
207-
sed -i 's|<base href="/" />|<base href="/SchemaMagic/" />|g' dist/index.html
208-
touch dist/.nojekyll
209-
cp dist/index.html dist/404.html
210-
echo "${{ steps.nbgv.outputs.version }}" > dist/version.txt
200+
# Determine the correct directory structure
201+
if [ -d "publish/wwwroot" ]; then
202+
echo "[INFO] Found publish/wwwroot/ - using it as deployment root"
203+
DEPLOY_DIR="publish/wwwroot"
211204
else
212-
echo "[ERROR] Could not find index.html in dist/ or dist/wwwroot/"
213-
exit 1
205+
echo "[INFO] No wwwroot subdirectory - using publish/ as deployment root"
206+
DEPLOY_DIR="publish"
214207
fi
215-
216-
echo "[SUCCESS] GitHub Pages configuration complete"
217-
echo "[INFO] Version: ${{ steps.nbgv.outputs.version }}"
218-
219-
- name: Upload artifact
220-
uses: actions/upload-pages-artifact@v3
221-
with:
222-
path: dist/wwwroot/
223-
224-
- name: Deploy to GitHub Pages
225-
id: deployment
226-
uses: actions/deploy-pages@v4
227-
228-
- name: Deployment Summary
229-
run: |
230-
echo "### Deployment Successful!" >> $GITHUB_STEP_SUMMARY
231-
echo "" >> $GITHUB_STEP_SUMMARY
232-
echo "**Version:** ${{ steps.nbgv.outputs.version }}" >> $GITHUB_STEP_SUMMARY
233-
echo "**URL:** ${{ steps.deployment.outputs.page_url }}" >> $GITHUB_STEP_SUMMARY
234-
echo "**Deployed:** $(date -u +'%Y-%m-%d %H:%M:%S UTC')" >> $GITHUB_STEP_SUMMARY
208+

.github/workflows/deploy-web.yml

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -60,54 +60,67 @@ jobs:
6060
run: dotnet restore SchemaMagic.Web/SchemaMagic.Web.csproj
6161

6262
- name: Publish
63-
run: dotnet publish SchemaMagic.Web/SchemaMagic.Web.csproj --configuration Release --output dist/
63+
run: dotnet publish SchemaMagic.Web/SchemaMagic.Web.csproj --configuration Release --output publish/
6464

6565
- name: List published files
6666
run: |
6767
echo "Listing published files for debugging..."
68-
echo "Contents of dist/:"
69-
ls -la dist/
68+
echo "Contents of publish/:"
69+
ls -la publish/
70+
echo ""
71+
echo "Contents of publish/wwwroot/:"
72+
ls -la publish/wwwroot/ || echo "No wwwroot directory"
7073
echo ""
7174
echo "Searching for ALL index.html files:"
72-
find dist/ -name "index.html" -type f || echo "No index.html found"
75+
find publish/ -name "index.html" -type f || echo "No index.html found"
7376
echo ""
74-
echo "First 50 files in dist/:"
75-
find dist/ -type f | head -50
77+
echo "Searching for _framework directory:"
78+
find publish/ -type d -name "_framework" || echo "No _framework directory found"
7679
7780
- name: Configure for GitHub Pages
7881
run: |
7982
echo "Configuring for GitHub Pages..."
8083
81-
# Base href is already "/" in index.html for custom domain (schema.magicsuite.net)
82-
# No need to change it anymore since we're using a custom domain
84+
# Determine the correct directory structure
85+
if [ -d "publish/wwwroot" ]; then
86+
echo "Found publish/wwwroot/ - using it as deployment root"
87+
DEPLOY_DIR="publish/wwwroot"
88+
else
89+
echo "No wwwroot subdirectory - using publish/ as deployment root"
90+
DEPLOY_DIR="publish"
91+
fi
8392
8493
# Add .nojekyll file to prevent GitHub Pages from processing as Jekyll site
85-
touch dist/wwwroot/.nojekyll
94+
touch ${DEPLOY_DIR}/.nojekyll
8695
8796
# Copy 404.html for SPA routing
88-
cp dist/wwwroot/index.html dist/wwwroot/404.html
97+
cp ${DEPLOY_DIR}/index.html ${DEPLOY_DIR}/404.html
8998
9099
# Ensure CNAME file is present for custom domain
91100
if [ -f "SchemaMagic.Web/wwwroot/CNAME" ]; then
92-
cp SchemaMagic.Web/wwwroot/CNAME dist/wwwroot/CNAME
93-
echo "CNAME file copied: $(cat dist/wwwroot/CNAME)"
101+
cp SchemaMagic.Web/wwwroot/CNAME ${DEPLOY_DIR}/CNAME
102+
echo "CNAME file copied: $(cat ${DEPLOY_DIR}/CNAME)"
94103
else
95104
echo "Warning: CNAME file not found"
96105
fi
97106
98107
# Add version info file
99-
echo "${{ steps.nbgv.outputs.fullVersion }}" > dist/wwwroot/version.txt
100-
date -u +'%Y-%m-%d %H:%M:%S UTC' > dist/wwwroot/deployed.txt
108+
echo "${{ steps.nbgv.outputs.fullVersion }}" > ${DEPLOY_DIR}/version.txt
109+
date -u +'%Y-%m-%d %H:%M:%S UTC' > ${DEPLOY_DIR}/deployed.txt
101110
102111
echo "Configuration complete"
103112
echo "Version: ${{ steps.nbgv.outputs.version }}"
104-
echo "Build size: $(du -sh dist/wwwroot | cut -f1)"
113+
echo "Build size: $(du -sh ${DEPLOY_DIR} | cut -f1)"
105114
echo "Custom domain: schema.magicsuite.net"
115+
echo "Deployment directory: ${DEPLOY_DIR}"
116+
117+
# Save deployment directory for next step
118+
echo "DEPLOY_DIR=${DEPLOY_DIR}" >> $GITHUB_ENV
106119
107120
- name: Upload artifact
108121
uses: actions/upload-pages-artifact@v3
109122
with:
110-
path: dist/wwwroot/
123+
path: ${{ env.DEPLOY_DIR }}
111124

112125
- name: Deploy to GitHub Pages
113126
id: deployment

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Changelog
1+
# Changelog
22

33
All notable changes to this project will be documented in this file.
44

PUBLISHING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Publishing SchemaMagic to NuGet
1+
# Publishing SchemaMagic to NuGet
22

33
This guide explains how to publish SchemaMagic as a .NET Global Tool to NuGet.org and deploy the web application to GitHub Pages.
44

monitor-certificate.ps1

Lines changed: 0 additions & 141 deletions
This file was deleted.

0 commit comments

Comments
 (0)