Skip to content

Commit a6cf997

Browse files
authored
Merge branch 'master' into pks/reponsename-fix
2 parents 32fe70b + adcaec8 commit a6cf997

File tree

332 files changed

+22949
-2430
lines changed

Some content is hidden

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

332 files changed

+22949
-2430
lines changed

.claude/settings.local.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(dir:*)",
5+
"Bash(cat:*)",
6+
"Bash(dotnet build:*)",
7+
"Bash(dotnet test:*)",
8+
"Bash(dotnet pack:*)"
9+
]
10+
}
11+
}

.github/workflows/ci.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Check PR
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
run-ci:
11+
env:
12+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13+
runs-on: windows-latest
14+
15+
steps:
16+
- name: Get latest code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup .NET
20+
uses: actions/setup-dotnet@v4
21+
with:
22+
dotnet-version: |
23+
8.x
24+
10.x
25+
26+
- name: Set XrmMockup365 version from RELEASE_NOTES.md
27+
shell: pwsh
28+
run: ./scripts/Set-VersionFromChangelog.ps1 -ChangelogPath ./RELEASE_NOTES.md -CsprojPath ./src/XrmMockup365/XrmMockup365.csproj
29+
30+
- name: Set MetadataGenerator.Tool version from CHANGELOG.md
31+
shell: pwsh
32+
run: ./scripts/Set-VersionFromChangelog.ps1 -ChangelogPath ./src/MetadataGen/MetadataGenerator.Tool/CHANGELOG.md -CsprojPath ./src/MetadataGen/MetadataGenerator.Tool/MetadataGenerator.Tool.csproj
33+
34+
- name: Set MetadataGenerator.Core version from CHANGELOG.md
35+
shell: pwsh
36+
run: ./scripts/Set-VersionFromChangelog.ps1 -ChangelogPath ./src/MetadataGen/MetadataGenerator.Tool/CHANGELOG.md -CsprojPath ./src/MetadataGen/MetadataGenerator.Core/MetadataGenerator.Core.csproj
37+
38+
- name: Set MetadataGenerator.Context version from CHANGELOG.md
39+
shell: pwsh
40+
run: ./scripts/Set-VersionFromChangelog.ps1 -ChangelogPath ./src/MetadataGen/MetadataGenerator.Tool/CHANGELOG.md -CsprojPath ./src/MetadataGen/MetadataGenerator.Context/MetadataGenerator.Context.csproj
41+
42+
- name: Install dependencies
43+
run: dotnet restore
44+
45+
- name: Build solution
46+
run: dotnet build --configuration Release --no-restore
47+
48+
- name: Run tests
49+
run: dotnet test --configuration Release --no-build --verbosity normal
50+
51+
- name: Pack XrmMockup365
52+
run: dotnet pack src/XrmMockup365/XrmMockup365.csproj --configuration Release --no-build --output ./nupkg
53+
54+
- name: Pack MetadataGenerator.Tool
55+
run: dotnet pack src/MetadataGen/MetadataGenerator.Tool/MetadataGenerator.Tool.csproj --configuration Release --no-build --output ./nupkg
56+
57+
- name: Upload artifacts
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: packages
61+
path: ./nupkg

.github/workflows/release.yml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [released]
6+
workflow_dispatch:
7+
inputs:
8+
dry_run:
9+
description: 'Perform a dry run (skip actual NuGet publish)'
10+
required: false
11+
default: true
12+
type: boolean
13+
14+
run-name: ${{ github.event_name == 'release' && format('Release {0}', github.event.release.tag_name) || (github.event.inputs.dry_run == 'false' && 'Release (Manual)' || 'Release (Dry Run)') }}
15+
16+
jobs:
17+
build:
18+
runs-on: windows-latest
19+
permissions:
20+
contents: write # For release asset upload
21+
id-token: write # Required for OIDC token (NuGet Trusted Publishing)
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
26+
- name: Setup .NET
27+
uses: actions/setup-dotnet@v4
28+
with:
29+
dotnet-version: |
30+
8.x
31+
10.x
32+
33+
- name: Set XrmMockup365 version from RELEASE_NOTES.md
34+
shell: pwsh
35+
run: ./scripts/Set-VersionFromChangelog.ps1 -ChangelogPath ./RELEASE_NOTES.md -CsprojPath ./src/XrmMockup365/XrmMockup365.csproj
36+
37+
- name: Set MetadataGenerator.Tool version from CHANGELOG.md
38+
shell: pwsh
39+
run: ./scripts/Set-VersionFromChangelog.ps1 -ChangelogPath ./src/MetadataGen/MetadataGenerator.Tool/CHANGELOG.md -CsprojPath ./src/MetadataGen/MetadataGenerator.Tool/MetadataGenerator.Tool.csproj
40+
41+
- name: Set MetadataGenerator.Core version from CHANGELOG.md
42+
shell: pwsh
43+
run: ./scripts/Set-VersionFromChangelog.ps1 -ChangelogPath ./src/MetadataGen/MetadataGenerator.Tool/CHANGELOG.md -CsprojPath ./src/MetadataGen/MetadataGenerator.Core/MetadataGenerator.Core.csproj
44+
45+
- name: Set MetadataGenerator.Context version from CHANGELOG.md
46+
shell: pwsh
47+
run: ./scripts/Set-VersionFromChangelog.ps1 -ChangelogPath ./src/MetadataGen/MetadataGenerator.Tool/CHANGELOG.md -CsprojPath ./src/MetadataGen/MetadataGenerator.Context/MetadataGenerator.Context.csproj
48+
49+
- name: Restore dependencies
50+
run: dotnet restore
51+
52+
- name: Build
53+
run: dotnet build --configuration Release --no-restore
54+
55+
- name: Run tests
56+
run: dotnet test --configuration Release --no-build --verbosity normal
57+
58+
- name: Pack XrmMockup365
59+
run: dotnet pack src/XrmMockup365/XrmMockup365.csproj --configuration Release --no-build --output ./nupkg
60+
61+
- name: Pack MetadataGenerator.Tool
62+
run: dotnet pack src/MetadataGen/MetadataGenerator.Tool/MetadataGenerator.Tool.csproj --configuration Release --no-build --output ./nupkg
63+
64+
- name: Upload artifacts
65+
uses: actions/upload-artifact@v4
66+
with:
67+
name: packages
68+
path: ./nupkg
69+
70+
- name: Add packages to release
71+
uses: softprops/action-gh-release@v2
72+
if: github.event_name == 'release'
73+
with:
74+
files: |
75+
./nupkg/*.nupkg
76+
./nupkg/*.snupkg
77+
78+
- name: Login to NuGet (OIDC)
79+
id: nuget-login
80+
uses: nuget/login@v1
81+
with:
82+
user: ${{ secrets.NUGET_USER }}
83+
84+
- name: Publish to NuGet
85+
shell: pwsh
86+
run: |
87+
Write-Host "Looking for nupkg files..."
88+
$nupkgFiles = Get-ChildItem -Path "./nupkg/*.nupkg" -File
89+
90+
if ($nupkgFiles.Count -eq 0) {
91+
Write-Host "No nupkg files found in nupkg"
92+
exit 1
93+
}
94+
95+
Write-Host "Found $($nupkgFiles.Count) nupkg file(s):"
96+
foreach ($file in $nupkgFiles) {
97+
Write-Host " Full path: $($file.FullName)"
98+
Write-Host " Size: $([math]::Round($file.Length / 1KB, 2)) KB"
99+
}
100+
101+
# For automatic triggers (release events), always publish
102+
# For manual triggers, only publish if dry_run is explicitly set to false
103+
$isDryRun = "${{ github.event_name }}" -eq "workflow_dispatch" -and "${{ github.event.inputs.dry_run }}" -ne "false"
104+
105+
$apiKey = "${{ steps.nuget-login.outputs.NUGET_API_KEY }}"
106+
107+
if ($isDryRun) {
108+
Write-Host "Dry run mode - skipping NuGet publish"
109+
if ($apiKey -ne "") {
110+
Write-Host "- Has NuGet API key from login"
111+
} else {
112+
Write-Host "- WARNING: Missing NuGet API key from login"
113+
exit 1
114+
}
115+
} else {
116+
Write-Host "Publishing to NuGet..."
117+
foreach ($file in $nupkgFiles) {
118+
Write-Host "Publishing: $($file.FullName)"
119+
dotnet nuget push "$($file.FullName)" --api-key $apiKey --source "https://api.nuget.org/v3/index.json" --skip-duplicate
120+
}
121+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ TestResults.xml
185185

186186
# Nuget outputs
187187
nuget/*.nupkg
188+
nupkg/
188189
release.cmd
189190
release.sh
190191
localpackages/

0 commit comments

Comments
 (0)