Skip to content

Commit f901a9f

Browse files
Merge branch 'main' into dependabot/nuget/src/Blazor.Demo/Microsoft.AspNetCore.Components.WebAssembly-7.0.20
2 parents 307347d + 0fe0f3a commit f901a9f

File tree

11 files changed

+218
-484
lines changed

11 files changed

+218
-484
lines changed

.github/codeql/codeql-config.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: "CodeQL Config"
2+
3+
# Only analyze C# - no JavaScript
4+
languages:
5+
- csharp
6+
7+
# Disable auto-detection of other languages
8+
disable-default-queries: false
9+
10+
queries:
11+
- uses: security-extended
12+
- uses: security-and-quality
13+
14+
# Paths to exclude
15+
paths-ignore:
16+
- '**/*.js'
17+
- '**/*.ts'
18+
- '**/node_modules/**'
19+
- '**/wwwroot/**/*.js'
20+

.github/workflows/build.yml

Lines changed: 11 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ jobs:
1818

1919
steps:
2020
- name: 📥 Checkout
21-
uses: actions/checkout@v4
22-
with:
23-
fetch-depth: 0 # برای GitVersion
21+
uses: actions/checkout@v6
2422

2523
- name: ⚙️ Setup .NET
2624
uses: actions/setup-dotnet@v4
@@ -30,42 +28,16 @@ jobs:
3028
- name: 📦 Restore dependencies
3129
run: dotnet restore JsonViewer.Blazor.sln
3230

33-
- name: 🏗️ Build
34-
run: dotnet build JsonViewer.Blazor.sln --no-restore --configuration Release
31+
- name: 🏗️ Build Component
32+
run: dotnet build src/Component/Component.csproj --no-restore --configuration Release
3533

36-
- name: 🧪 Test
37-
run: dotnet test JsonViewer.Blazor.sln --no-build --configuration Release --verbosity normal
34+
- name: 🏗️ Build Demo
35+
run: dotnet build src/Blazor.Demo/Blazor.Demo.csproj --no-restore --configuration Release
3836

39-
- name: 📊 Code Coverage
37+
- name: ✅ Build Summary
4038
run: |
41-
dotnet test JsonViewer.Blazor.sln \
42-
--no-build \
43-
--configuration Release \
44-
--collect:"XPlat Code Coverage" \
45-
--results-directory ./coverage
46-
47-
- name: 📤 Upload Coverage
48-
uses: codecov/codecov-action@v3
49-
with:
50-
directory: ./coverage
51-
fail_ci_if_error: false
52-
53-
analyze:
54-
name: 🔍 Code Analysis
55-
runs-on: ubuntu-latest
56-
57-
steps:
58-
- name: 📥 Checkout
59-
uses: actions/checkout@v4
60-
61-
- name: ⚙️ Setup .NET
62-
uses: actions/setup-dotnet@v4
63-
with:
64-
dotnet-version: ${{ env.DOTNET_VERSION }}
65-
66-
- name: 🔍 Format Check
67-
run: dotnet format JsonViewer.Blazor.sln --verify-no-changes --no-restore
68-
69-
- name: 📊 Code Analysis
70-
run: dotnet build JsonViewer.Blazor.sln -warnaserror
71-
39+
echo "## 🏗️ Build Summary" >> $GITHUB_STEP_SUMMARY
40+
echo "" >> $GITHUB_STEP_SUMMARY
41+
echo "- **Component**: ✅ Built successfully" >> $GITHUB_STEP_SUMMARY
42+
echo "- **Demo**: ✅ Built successfully" >> $GITHUB_STEP_SUMMARY
43+
echo "- **.NET Version**: ${{ env.DOTNET_VERSION }}" >> $GITHUB_STEP_SUMMARY

.github/workflows/codeql.yml

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,48 @@ on:
77
branches: [ main ]
88
schedule:
99
- cron: '0 0 * * 1' # Every Monday at midnight
10+
workflow_dispatch:
1011

1112
jobs:
1213
analyze:
13-
name: 🔍 Analyze Code
14+
name: 🔍 Analyze C#
1415
runs-on: ubuntu-latest
16+
1517
permissions:
1618
actions: read
1719
contents: read
1820
security-events: write
19-
20-
strategy:
21-
fail-fast: false
22-
matrix:
23-
language: [ 'csharp', 'javascript' ]
21+
packages: read
2422

2523
steps:
2624
- name: 📥 Checkout repository
27-
uses: actions/checkout@v4
25+
uses: actions/checkout@v6
26+
27+
- name: 🔧 Setup .NET
28+
uses: actions/setup-dotnet@v4
29+
with:
30+
dotnet-version: '7.0.x'
2831

2932
- name: ⚙️ Initialize CodeQL
30-
uses: github/codeql-action/init@v2
33+
uses: github/codeql-action/init@v3
3134
with:
32-
languages: ${{ matrix.language }}
33-
queries: security-extended,security-and-quality
35+
languages: csharp
36+
config-file: ./.github/codeql/codeql-config.yml
37+
38+
- name: 🏗️ Build Projects
39+
run: |
40+
echo "📦 Restoring dependencies..."
41+
dotnet restore JsonViewer.Blazor.sln
42+
43+
echo "🏗️ Building Component..."
44+
dotnet build src/Component/Component.csproj -c Release --no-restore
45+
46+
echo "🏗️ Building Demo..."
47+
dotnet build src/Blazor.Demo/Blazor.Demo.csproj -c Release --no-restore
3448
35-
- name: 🏗️ Autobuild
36-
uses: github/codeql-action/autobuild@v2
49+
echo "✅ Build completed"
3750
3851
- name: 🔍 Perform CodeQL Analysis
39-
uses: github/codeql-action/analyze@v2
52+
uses: github/codeql-action/analyze@v3
4053
with:
41-
category: "/language:${{matrix.language}}"
54+
category: "/language:csharp"

.github/workflows/deploy-pages.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: 🚀 Deploy to GitHub Pages
33
on:
44
push:
55
branches: [ main ]
6+
paths:
7+
- 'src/**'
8+
- '.github/workflows/deploy-pages.yml'
69
workflow_dispatch:
710

811
permissions:
@@ -26,7 +29,7 @@ jobs:
2629

2730
steps:
2831
- name: 📥 Checkout
29-
uses: actions/checkout@v4
32+
uses: actions/checkout@v6
3033

3134
- name: ⚙️ Setup .NET
3235
uses: actions/setup-dotnet@v4
@@ -46,16 +49,27 @@ jobs:
4649
-o release \
4750
--nologo
4851
49-
- name: 🔧 Configure base path
52+
- name: 🔧 Configure base path for GitHub Pages
5053
run: |
51-
sed -i 's/<base href="\/" \/>/<base href="\/Blazor\/" \/>/g' release/wwwroot/index.html
54+
# Fix base href for GitHub Pages subdirectory
55+
sed -i 's|<base href="/" />|<base href="/Blazor/" />|g' release/wwwroot/index.html
56+
echo "✅ Base href updated to /Blazor/"
57+
grep "<base" release/wwwroot/index.html
5258
5359
- name: 📝 Add .nojekyll file
5460
run: touch release/wwwroot/.nojekyll
5561

56-
- name: 📝 Add custom 404.html
62+
- name: 📝 Create 404.html for SPA routing
5763
run: cp release/wwwroot/index.html release/wwwroot/404.html
5864

65+
- name: 📋 List published files
66+
run: |
67+
echo "📂 Contents of release/wwwroot:"
68+
ls -la release/wwwroot/
69+
70+
- name: ⚙️ Setup Pages
71+
uses: actions/configure-pages@v5
72+
5973
- name: 📤 Upload artifact
6074
uses: actions/upload-pages-artifact@v3
6175
with:
@@ -74,4 +88,3 @@ jobs:
7488
- name: 🌐 Deploy to GitHub Pages
7589
id: deployment
7690
uses: actions/deploy-pages@v4
77-

.github/workflows/nuget-publish.yml

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ on:
88
version:
99
description: 'Version to publish (e.g., 1.0.0)'
1010
required: true
11-
prerelease:
12-
description: 'Is this a prerelease?'
13-
type: boolean
14-
default: false
11+
default: '0.0.3-beta'
1512

1613
env:
1714
DOTNET_VERSION: '7.0.x'
@@ -25,7 +22,7 @@ jobs:
2522

2623
steps:
2724
- name: 📥 Checkout
28-
uses: actions/checkout@v4
25+
uses: actions/checkout@v6
2926
with:
3027
fetch-depth: 0
3128

@@ -34,25 +31,40 @@ jobs:
3431
with:
3532
dotnet-version: ${{ env.DOTNET_VERSION }}
3633

34+
- name: 🔍 Determine Version
35+
id: version
36+
run: |
37+
if [ "${{ github.event_name }}" == "release" ]; then
38+
VERSION="${{ github.event.release.tag_name }}"
39+
# Remove 'v' prefix if present
40+
VERSION="${VERSION#v}"
41+
else
42+
VERSION="${{ github.event.inputs.version }}"
43+
fi
44+
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
45+
echo "📦 Package Version: $VERSION"
46+
3747
- name: 📦 Restore dependencies
38-
run: dotnet restore JsonViewer.Blazor.sln
48+
run: dotnet restore ${{ env.PROJECT_PATH }}
3949

4050
- name: 🏗️ Build
41-
run: dotnet build JsonViewer.Blazor.sln --configuration Release --no-restore
42-
43-
- name: 🧪 Run tests
44-
run: dotnet test JsonViewer.Blazor.sln --configuration Release --no-build --verbosity normal
51+
run: dotnet build ${{ env.PROJECT_PATH }} --configuration Release --no-restore
4552

4653
- name: 📦 Pack Component
4754
run: |
4855
dotnet pack ${{ env.PROJECT_PATH }} \
4956
--configuration Release \
5057
--no-build \
5158
--output ./packages \
52-
/p:PackageVersion=${{ github.event.inputs.version || github.event.release.tag_name }} \
59+
/p:PackageVersion=${{ steps.version.outputs.VERSION }} \
5360
/p:IncludeSymbols=true \
5461
/p:SymbolPackageFormat=snupkg
5562
63+
- name: 📋 List Packages
64+
run: |
65+
echo "📦 Created packages:"
66+
ls -la ./packages/
67+
5668
- name: 🚀 Push to NuGet
5769
run: |
5870
dotnet nuget push ./packages/*.nupkg \
@@ -61,17 +73,15 @@ jobs:
6173
--skip-duplicate
6274
6375
- name: 📤 Upload NuGet Package Artifacts
64-
uses: actions/upload-artifact@v3
76+
uses: actions/upload-artifact@v5
6577
with:
6678
name: nuget-packages
67-
path: ./packages/*.nupkg
79+
path: ./packages/*
6880

69-
- name: 📝 Create Release Notes
70-
if: github.event_name == 'release'
81+
- name: 📝 Create Summary
7182
run: |
7283
echo "## 📦 NuGet Package Published" >> $GITHUB_STEP_SUMMARY
7384
echo "" >> $GITHUB_STEP_SUMMARY
7485
echo "- **Package**: JsonViewer.Blazor" >> $GITHUB_STEP_SUMMARY
75-
echo "- **Version**: ${{ github.event.release.tag_name }}" >> $GITHUB_STEP_SUMMARY
86+
echo "- **Version**: ${{ steps.version.outputs.VERSION }}" >> $GITHUB_STEP_SUMMARY
7687
echo "- **NuGet**: https://www.nuget.org/packages/JsonViewer.Blazor" >> $GITHUB_STEP_SUMMARY
77-

0 commit comments

Comments
 (0)