55 branches : [ main, develop ]
66 pull_request :
77 branches : [ main ]
8+ release :
9+ types : [published]
10+
11+ env :
12+ DOTNET_VERSION : ' 9.0.x'
13+ NUGET_SOURCE : https://api.nuget.org/v3/index.json
14+ GITHUB_PACKAGES_SOURCE : https://nuget.pkg.github.com/byerlikaya/index.json
815
916jobs :
1017 test :
11- name : Test
18+ name : Test & Quality
1219 runs-on : ubuntu-latest
1320 permissions :
1421 contents : read
@@ -20,15 +27,15 @@ jobs:
2027 - name : Setup .NET
2128 uses : actions/setup-dotnet@v4
2229 with :
23- dotnet-version : ' 9.0.x '
30+ dotnet-version : ${{ env.DOTNET_VERSION }}
2431
2532 - name : Restore dependencies
2633 run : dotnet restore
2734
2835 - name : Build
2936 run : dotnet build --no-restore --configuration Release
3037
31- - name : Test
38+ - name : Run tests
3239 run : dotnet test --no-build --configuration Release --verbosity normal --collect:"XPlat Code Coverage" --logger trx --results-directory ./TestResults
3340
3441 - name : Upload coverage reports to Codecov
@@ -39,12 +46,18 @@ jobs:
3946 flags : unittests
4047 name : codecov-umbrella
4148 fail_ci_if_error : false
49+
50+ - name : Run code analysis
51+ run : dotnet build --configuration Release --verbosity quiet
52+
53+ - name : Check for vulnerabilities
54+ run : dotnet list package --vulnerable
4255
4356 build :
4457 name : Build & Package
4558 runs-on : ubuntu-latest
4659 needs : test
47- if : github.ref == 'refs/heads/main'
60+ if : github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop'
4861 permissions :
4962 contents : read
5063 pull-requests : read
@@ -55,24 +68,25 @@ jobs:
5568 - name : Setup .NET
5669 uses : actions/setup-dotnet@v4
5770 with :
58- dotnet-version : ' 9.0.x '
71+ dotnet-version : ${{ env.DOTNET_VERSION }}
5972
6073 - name : Restore dependencies
6174 run : dotnet restore
6275
6376 - name : Build
6477 run : dotnet build --no-restore --configuration Release
6578
66- - name : Pack
67- run : dotnet pack src/SmartRAG/SmartRAG.csproj --no-build --configuration Release --output ./nupkgs
79+ - name : Pack NuGet packages
80+ run : |
81+ dotnet pack src/SmartRAG/SmartRAG.csproj --no-build --configuration Release --output ./nupkgs
6882
6983 - name : Upload artifacts
7084 uses : actions/upload-artifact@v4
7185 with :
7286 name : nuget-packages
7387 path : ./nupkgs/*.nupkg
7488
75- publish :
89+ publish-nuget :
7690 name : Publish to NuGet
7791 runs-on : ubuntu-latest
7892 needs : build
@@ -91,18 +105,47 @@ jobs:
91105 - name : Setup .NET
92106 uses : actions/setup-dotnet@v4
93107 with :
94- dotnet-version : ' 9.0.x '
108+ dotnet-version : ${{ env.DOTNET_VERSION }}
95109
96110 - name : Publish to NuGet
97- run : dotnet nuget push ./nupkgs/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
98-
111+ run : |
112+ for package in ./nupkgs/*.nupkg; do
113+ echo "Publishing $package to NuGet..."
114+ dotnet nuget push "$package" --api-key ${{ secrets.NUGET_API_KEY }} --source ${{ env.NUGET_SOURCE }} --skip-duplicate
115+ done
116+
117+ publish-github-packages :
118+ name : Publish to GitHub Packages
119+ runs-on : ubuntu-latest
120+ needs : build
121+ if : github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop'
122+ permissions :
123+ contents : read
124+ packages : write
125+
126+ steps :
127+ - name : Download artifacts
128+ uses : actions/download-artifact@v4
129+ with :
130+ name : nuget-packages
131+ path : ./nupkgs
132+
133+ - name : Setup .NET
134+ uses : actions/setup-dotnet@v4
135+ with :
136+ dotnet-version : ${{ env.DOTNET_VERSION }}
137+
99138 - name : Publish to GitHub Packages
100- run : dotnet nuget push ./nupkgs/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/byerlikaya/index.json --skip-duplicate
139+ run : |
140+ for package in ./nupkgs/*.nupkg; do
141+ echo "Publishing $package to GitHub Packages..."
142+ dotnet nuget push "$package" --api-key ${{ secrets.GITHUB_TOKEN }} --source ${{ env.GITHUB_PACKAGES_SOURCE }} --skip-duplicate
143+ done
101144
102- release :
145+ create- release :
103146 name : Create GitHub Release
104147 runs-on : ubuntu-latest
105- needs : [build, publish]
148+ needs : [build, publish-nuget ]
106149 if : github.ref == 'refs/heads/main' && contains(github.event.head_commit.message, '[release]')
107150 permissions :
108151 contents : write
@@ -122,33 +165,44 @@ jobs:
122165 - name : Get version from package
123166 id : get_version
124167 run : |
125- # Try to get version from csproj file first
126- PACKAGE_VERSION=$(grep -o '<PackageVersion>.*</PackageVersion>' src/SmartRAG/SmartRAG.csproj | sed 's/<PackageVersion>\(.*\)<\/PackageVersion>/\1/')
127-
128- # Fallback to dotnet list package if csproj method fails
129- if [ -z "$PACKAGE_VERSION" ]; then
130- PACKAGE_VERSION=$(dotnet list package --format json | jq -r '.projects[0].frameworks[].packages[] | select(.id=="SmartRAG") | .resolved // empty' 2>/dev/null || echo "1.0.2")
131- fi
132-
133- # Final fallback
134- if [ -z "$PACKAGE_VERSION" ]; then
135- PACKAGE_VERSION="1.0.2"
136- fi
168+ PACKAGE_VERSION=$(dotnet list package --format json | jq -r '.projects[0].frameworks[].packages[] | select(.id=="SmartRAG") | .resolved')
137169
138170 echo "version=$PACKAGE_VERSION" >> $GITHUB_OUTPUT
139171 echo "Package version: $PACKAGE_VERSION"
140172
173+ - name : Generate changelog
174+ id : changelog
175+ run : |
176+ # Get commits since last release
177+ LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
178+ if [ -n "$LAST_TAG" ]; then
179+ CHANGELOG=$(git log --pretty=format:"- %s (%an)" ${LAST_TAG}..HEAD | grep -v "Merge pull request" | grep -v "Merge branch")
180+ else
181+ CHANGELOG=$(git log --pretty=format:"- %s (%an)" --oneline -20 | grep -v "Merge pull request" | grep -v "Merge branch")
182+ fi
183+ echo "changelog<<EOF" >> $GITHUB_OUTPUT
184+ echo "$CHANGELOG" >> $GITHUB_OUTPUT
185+ echo "EOF" >> $GITHUB_OUTPUT
186+
141187 - name : Create Release
142188 uses : actions/create-release@v1
143189 env :
144190 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
145191 with :
146192 tag_name : v${{ steps.get_version.outputs.version }}
147- release_name : Release v${{ steps.get_version.outputs.version }}
193+ release_name : SmartRAG v${{ steps.get_version.outputs.version }}
148194 body : |
149- ## What's New
195+ ## π What's New in v${{ steps.get_version.outputs.version }}
196+
197+ ### β¨ Latest Features
198+ - π§ **Enhanced Semantic Search** - Advanced hybrid scoring (80% semantic + 20% keyword)
199+ - π **Smart Document Chunking** - Word boundary validation and optimal break points
200+ - π§ **SemanticSearchService** - Dedicated service for semantic relevance scoring
201+ - βοΈ **Configuration Binding Fix** - User settings now take absolute priority
202+ - π§ **Improved Error Handling** - Better logging and retry mechanisms
203+ - π **Performance Optimizations** - Faster chunking and search algorithms
150204
151- ### Latest Release (v${{ steps.get_version.outputs.version }})
205+ ### π§ Previous Features
152206 - π§ **Smart Query Intent Detection** - Automatically routes queries to chat vs document search
153207 - π **Language-Agnostic Design** - Removed all hardcoded language patterns
154208 - π **Enhanced Search Relevance** - Improved name detection and content scoring
@@ -159,13 +213,31 @@ jobs:
159213 - π§Ή **Configuration Cleanup** - Removed unnecessary fields
160214 - π― **Project Simplification** - Streamlined for better performance
161215
162- ## Downloads
163- - NuGet Package: [SmartRAG v${{ steps.get_version.outputs.version }}](https://www.nuget.org/packages/SmartRAG/${{ steps.get_version.outputs.version }})
216+ ## π¦ Downloads
217+ - **NuGet Package**: [SmartRAG v${{ steps.get_version.outputs.version }}](https://www.nuget.org/packages/SmartRAG/${{ steps.get_version.outputs.version }})
218+ - **GitHub Packages**: Available in this repository
164219
165- ## Installation
220+ ## π Installation
166221 ```bash
222+ # NuGet
167223 dotnet add package SmartRAG --version ${{ steps.get_version.outputs.version }}
224+
225+ # GitHub Packages
226+ dotnet add package SmartRAG --version ${{ steps.get_version.outputs.version }} --source https://nuget.pkg.github.com/byerlikaya/index.json
168227 ```
228+
229+ ## π Recent Changes
230+ ${{ steps.changelog.outputs.changelog }}
231+
232+ ## π Links
233+ - π [Documentation](https://github.com/byerlikaya/SmartRAG#readme)
234+ - π [Report Issues](https://github.com/byerlikaya/SmartRAG/issues)
235+ - π¬ [Discussions](https://github.com/byerlikaya/SmartRAG/discussions)
236+ - π§ [Contact](mailto:b.yerlikaya@outlook.com)
237+
238+ ---
239+
240+ **Built with β€οΈ by BarΔ±Ε Yerlikaya** | Made in Turkey πΉπ·
169241 draft : false
170242 prerelease : false
171243
@@ -178,3 +250,50 @@ jobs:
178250 asset_path : ./nupkgs/*.nupkg
179251 asset_name : SmartRAG.${{ steps.get_version.outputs.version }}.nupkg
180252 asset_content_type : application/octet-stream
253+
254+ security-scan :
255+ name : Security Scan
256+ runs-on : ubuntu-latest
257+ needs : test
258+ if : github.ref == 'refs/heads/main'
259+ permissions :
260+ contents : read
261+ security-events : write
262+
263+ steps :
264+ - uses : actions/checkout@v4
265+
266+ - name : Setup .NET
267+ uses : actions/setup-dotnet@v4
268+ with :
269+ dotnet-version : ${{ env.DOTNET_VERSION }}
270+
271+ - name : Run security scan
272+ run : |
273+ dotnet list package --vulnerable
274+ dotnet outdated --upgrade
275+
276+ - name : Run CodeQL Analysis
277+ uses : github/codeql-action/init@v3
278+ with :
279+ languages : csharp
280+
281+ - name : Perform CodeQL Analysis
282+ uses : github/codeql-action/analyze@v3
283+
284+ dependency-review :
285+ name : Dependency Review
286+ runs-on : ubuntu-latest
287+ if : github.event_name == 'pull_request'
288+ permissions :
289+ contents : read
290+ pull-requests : read
291+
292+ steps :
293+ - name : Checkout Repository
294+ uses : actions/checkout@v4
295+
296+ - name : Dependency Review
297+ uses : actions/dependency-review-action@v4
298+ with :
299+ fail-on-severity : moderate
0 commit comments