Skip to content

Commit 32af67f

Browse files
authored
V10.3.0/launch (#149)
📦️ updated NuGet package definition ⬆️ bump dependencies 💬 updated community health pages 👷 add workflows for service updates and downstream triggers
1 parent d08371b commit 32af67f

47 files changed

Lines changed: 543 additions & 7 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dispatch-targets.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[
2+
"xunit"
3+
]
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
name: Service Update
2+
3+
on:
4+
repository_dispatch:
5+
types: [codebelt-service-update]
6+
workflow_dispatch:
7+
inputs:
8+
source_repo:
9+
description: 'Triggering source repo name (e.g. cuemon)'
10+
required: false
11+
default: ''
12+
source_version:
13+
description: 'Version released by source (e.g. 10.3.0)'
14+
required: false
15+
default: ''
16+
dry_run:
17+
type: boolean
18+
description: 'Dry run — show changes but do not commit or open PR'
19+
default: false
20+
21+
permissions:
22+
contents: write
23+
pull-requests: write
24+
25+
jobs:
26+
service-update:
27+
runs-on: ubuntu-24.04
28+
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0
34+
35+
- name: Resolve trigger inputs
36+
id: trigger
37+
run: |
38+
SOURCE="${{ github.event.client_payload.source_repo || github.event.inputs.source_repo }}"
39+
VERSION="${{ github.event.client_payload.source_version || github.event.inputs.source_version }}"
40+
echo "source=$SOURCE" >> $GITHUB_OUTPUT
41+
echo "version=$VERSION" >> $GITHUB_OUTPUT
42+
43+
- name: Determine new version for this repo
44+
id: newver
45+
run: |
46+
CURRENT=$(grep -oP '(?<=## \[)[\d.]+(?=\])' CHANGELOG.md | head -1)
47+
NEW=$(echo "$CURRENT" | awk -F. '{printf "%s.%s.%d", $1, $2, $3+1}')
48+
BRANCH="v${NEW}/service-update"
49+
echo "current=$CURRENT" >> $GITHUB_OUTPUT
50+
echo "new=$NEW" >> $GITHUB_OUTPUT
51+
echo "branch=$BRANCH" >> $GITHUB_OUTPUT
52+
53+
- name: Generate codebelt-aicia token
54+
id: app-token
55+
uses: actions/create-github-app-token@v1
56+
with:
57+
app-id: ${{ vars.CODEBELT_AICIA_APP_ID }}
58+
private-key: ${{ secrets.CODEBELT_AICIA_PRIVATE_KEY }}
59+
owner: codebeltnet
60+
61+
- name: Bump NuGet packages
62+
run: python3 .github/scripts/bump-nuget.py
63+
env:
64+
TRIGGER_SOURCE: ${{ steps.trigger.outputs.source }}
65+
TRIGGER_VERSION: ${{ steps.trigger.outputs.version }}
66+
67+
- name: Update PackageReleaseNotes.txt
68+
run: |
69+
NEW="${{ steps.newver.outputs.new }}"
70+
for f in .nuget/*/PackageReleaseNotes.txt; do
71+
[ -f "$f" ] || continue
72+
TFM=$(grep -m1 "^Availability:" "$f" | sed 's/Availability: //' || echo ".NET 10, .NET 9 and .NET Standard 2.0")
73+
ENTRY="Version ${NEW}\nAvailability: ${TFM}\n \n# ALM\n- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)\n \n"
74+
{ printf "$ENTRY"; cat "$f"; } > "$f.tmp" && mv "$f.tmp" "$f"
75+
done
76+
77+
- name: Update CHANGELOG.md
78+
run: |
79+
python3 - <<'EOF'
80+
import os, re
81+
from datetime import date
82+
new_ver = os.environ['NEW_VERSION']
83+
today = date.today().isoformat()
84+
entry = f"## [{new_ver}] - {today}\n\nThis is a service update that focuses on package dependencies.\n\n"
85+
with open("CHANGELOG.md") as f:
86+
content = f.read()
87+
idx = content.find("## [")
88+
content = (content[:idx] + entry + content[idx:]) if idx != -1 else (content + entry)
89+
with open("CHANGELOG.md", "w") as f:
90+
f.write(content)
91+
print(f"CHANGELOG updated for v{new_ver}")
92+
EOF
93+
env:
94+
NEW_VERSION: ${{ steps.newver.outputs.new }}
95+
96+
# Note: Docker image bumps removed in favor of manual updates
97+
# The automated selection was picking wrong variants (e.g., mono-* instead of standard)
98+
# TODO: Move to hosted service for smarter image selection
99+
100+
- name: Show diff (dry run)
101+
if: ${{ github.event.inputs.dry_run == 'true' }}
102+
run: git diff
103+
104+
- name: Create branch and open PR
105+
if: ${{ github.event.inputs.dry_run != 'true' }}
106+
env:
107+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
108+
run: |
109+
NEW="${{ steps.newver.outputs.new }}"
110+
BRANCH="${{ steps.newver.outputs.branch }}"
111+
SOURCE="${{ steps.trigger.outputs.source }}"
112+
SRC_VER="${{ steps.trigger.outputs.version }}"
113+
114+
git config user.name "codebelt-aicia[bot]"
115+
git config user.email "codebelt-aicia[bot]@users.noreply.github.com"
116+
git checkout -b "$BRANCH"
117+
git add -A
118+
git diff --cached --quiet && echo "Nothing changed - skipping PR." && exit 0
119+
git commit -m "V${NEW}/service update"
120+
git push origin "$BRANCH"
121+
122+
echo "This is a service update that focuses on package dependencies." > pr_body.txt
123+
echo "" >> pr_body.txt
124+
echo "Automated changes:" >> pr_body.txt
125+
echo "- Codebelt/Cuemon package versions bumped to latest compatible" >> pr_body.txt
126+
echo "- PackageReleaseNotes.txt updated for v${NEW}" >> pr_body.txt
127+
echo "- CHANGELOG.md entry added for v${NEW}" >> pr_body.txt
128+
echo "" >> pr_body.txt
129+
echo "Note: Third-party packages (Microsoft.Extensions.*, BenchmarkDotNet, etc.) are not auto-updated." >> pr_body.txt
130+
echo "Use Dependabot or manual updates for those." >> pr_body.txt
131+
echo "" >> pr_body.txt
132+
echo "Generated by codebelt-aicia" >> pr_body.txt
133+
if [ -n "$SOURCE" ] && [ -n "$SRC_VER" ]; then
134+
echo "Triggered by: ${SOURCE} @ ${SRC_VER}" >> pr_body.txt
135+
else
136+
echo "Triggered by: manual workflow dispatch" >> pr_body.txt
137+
fi
138+
139+
gh pr create --title "V${NEW}/service update" --body-file pr_body.txt --base main --head "$BRANCH" --assignee gimlichael
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Trigger Downstream Service Updates
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
dispatch:
9+
if: github.event.release.prerelease == false
10+
runs-on: ubuntu-24.04
11+
permissions:
12+
contents: read
13+
14+
steps:
15+
- name: Checkout (to read dispatch-targets.json)
16+
uses: actions/checkout@v4
17+
18+
- name: Check for dispatch targets
19+
id: check
20+
run: |
21+
if [ ! -f .github/dispatch-targets.json ]; then
22+
echo "No dispatch-targets.json found, skipping."
23+
echo "has_targets=false" >> $GITHUB_OUTPUT
24+
exit 0
25+
fi
26+
COUNT=$(python3 -c "import json; print(len(json.load(open('.github/dispatch-targets.json'))))")
27+
echo "has_targets=$([ $COUNT -gt 0 ] && echo true || echo false)" >> $GITHUB_OUTPUT
28+
29+
- name: Extract version from release tag
30+
if: steps.check.outputs.has_targets == 'true'
31+
id: version
32+
run: |
33+
VERSION="${{ github.event.release.tag_name }}"
34+
VERSION="${VERSION#v}"
35+
echo "version=$VERSION" >> $GITHUB_OUTPUT
36+
37+
- name: Generate codebelt-aicia token
38+
if: steps.check.outputs.has_targets == 'true'
39+
id: app-token
40+
uses: actions/create-github-app-token@v1
41+
with:
42+
app-id: ${{ vars.CODEBELT_AICIA_APP_ID }}
43+
private-key: ${{ secrets.CODEBELT_AICIA_PRIVATE_KEY }}
44+
owner: codebeltnet
45+
46+
- name: Dispatch to downstream repos
47+
if: steps.check.outputs.has_targets == 'true'
48+
run: |
49+
python3 - <<'EOF'
50+
import json, urllib.request, os, sys
51+
52+
targets = json.load(open('.github/dispatch-targets.json'))
53+
token = os.environ['GH_TOKEN']
54+
version = os.environ['VERSION']
55+
source = os.environ['SOURCE_REPO']
56+
57+
for repo in targets:
58+
url = f'https://api.github.com/repos/codebeltnet/{repo}/dispatches'
59+
payload = json.dumps({
60+
'event_type': 'codebelt-service-update',
61+
'client_payload': {
62+
'source_repo': source,
63+
'source_version': version
64+
}
65+
}).encode()
66+
req = urllib.request.Request(url, data=payload, method='POST', headers={
67+
'Authorization': f'Bearer {token}',
68+
'Accept': 'application/vnd.github+json',
69+
'Content-Type': 'application/json',
70+
'X-GitHub-Api-Version': '2022-11-28'
71+
})
72+
with urllib.request.urlopen(req) as r:
73+
print(f'✓ Dispatched to {repo}: HTTP {r.status}')
74+
EOF
75+
env:
76+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
77+
VERSION: ${{ steps.version.outputs.version }}
78+
SOURCE_REPO: ${{ github.event.repository.name }}

.nuget/Cuemon.AspNetCore.App/PackageReleaseNotes.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Version: 10.3.0
2+
Availability: .NET 10 and .NET 9
3+
 
4+
# ALM
5+
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)
6+
 
17
Version: 10.2.1
28
Availability: .NET 10 and .NET 9
39

.nuget/Cuemon.AspNetCore.Authentication/PackageReleaseNotes.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Version: 10.3.0
2+
Availability: .NET 10 and .NET 9
3+
 
4+
# ALM
5+
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)
6+
 
17
Version: 10.2.1
28
Availability: .NET 10 and .NET 9
39

.nuget/Cuemon.AspNetCore.Mvc/PackageReleaseNotes.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Version: 10.3.0
2+
Availability: .NET 10 and .NET 9
3+
 
4+
# ALM
5+
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)
6+
 
17
Version: 10.2.1
28
Availability: .NET 10 and .NET 9
39

.nuget/Cuemon.AspNetCore.Razor.TagHelpers/PackageReleaseNotes.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Version: 10.3.0
2+
Availability: .NET 10 and .NET 9
3+
 
4+
# ALM
5+
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)
6+
 
17
Version: 10.2.1
28
Availability: .NET 10 and .NET 9
39

.nuget/Cuemon.AspNetCore/PackageReleaseNotes.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Version: 10.3.0
2+
Availability: .NET 10 and .NET 9
3+
 
4+
# ALM
5+
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)
6+
 
17
Version: 10.2.1
28
Availability: .NET 10 and .NET 9
39

.nuget/Cuemon.Core.App/PackageReleaseNotes.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Version: 10.3.0
2+
Availability: .NET 10, .NET 9 and .NET Standard 2.0
3+
 
4+
# ALM
5+
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)
6+
 
17
Version: 10.2.1
28
Availability: .NET 10, .NET 9 and .NET Standard 2.0
39

.nuget/Cuemon.Core/PackageReleaseNotes.txt

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
Version: 10.3.0
2+
Availability: .NET 10, .NET 9 and .NET Standard 2.0
3+
 
4+
# ALM
5+
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)
6+
 
7+
# New Features
8+
- ADDED AssemblyContext class in the Cuemon.Reflection namespace that provides filtered discovery of assemblies in the current application domain, with optional traversal of referenced assemblies
9+
- ADDED AssemblyContextOptions class in the Cuemon.Reflection namespace that provides configuration options for AssemblyContext filtering and traversal
10+
- ADDED StackDecoratorExtensions class in the Cuemon.Collections.Generic namespace with TryPop extension method for IDecorator<Stack{T}>
11+
- ADDED Patterns class in the Cuemon namespace with two new methods: IsFatalException and IsRecoverableException
12+
 
13+
# Improvements
14+
- CHANGED Patterns class in the Cuemon namespace so TryInvoke overloads apply exception filters via IsFatalException and IsRecoverableException
15+
- CHANGED World class in the Cuemon.Globalization namespace where StatisticalRegions now returns IEnumerable<StatisticalRegionInfo>
16+
 
17+
# Bug Fixes
18+
- FIXED AssemblyContextOptions class in the Cuemon.Reflection namespace to safely handle recoverable reflection exceptions while inspecting exported types
19+
 
120
Version: 10.2.1
221
Availability: .NET 10, .NET 9 and .NET Standard 2.0
322

@@ -203,4 +222,4 @@ Availability: .NET 9, .NET 8 and .NET Standard 2.0
203222
- EXTENDED Validator class in the Cuemon namespace with five new methods: ThrowIfContainsReservedKeyword, ThrowIfNotDifferent, ThrowIfDifferent, ThrowIfContainsAny and ThrowIfNotContainsAny
204223
- CHANGED Validator class in the Cuemon namespace to comply with RSPEC-3343
205224
- EXTENDED Decorator class in the Cuemon namespace with an additional method: RawEnclose
206-
 
225+
 

0 commit comments

Comments
 (0)