Skip to content

Commit 41c7cf4

Browse files
authored
add xtb project for schema generation (#17)
* add xtb project for schema generation * fix longpath for ci-validation * fix longpath for ci-validation2 * . * . * . * .
1 parent e4430db commit 41c7cf4

File tree

49 files changed

+3140
-87
lines changed

Some content is hidden

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

49 files changed

+3140
-87
lines changed

.github/workflows/ci-pipeline-validation.yml renamed to .github/workflows/ci-linux-pipeline-validation.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will build a .NET project
22
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
33

4-
name: CI - Pipeline - Validation
4+
name: CI - Linux - Pipeline - Validation
55
permissions:
66
contents: read
77
issues: read
@@ -24,6 +24,7 @@ jobs:
2424
uses: actions/setup-dotnet@v3
2525
with:
2626
dotnet-version: 8.0.x
27+
2728
- name: Restore dependencies
2829
run: dotnet restore ${{ env.solutionPath }}
2930
- name: Build
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# This workflow will build a .NET project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3+
4+
name: CI - msbuild - Pipeline - Validation
5+
permissions:
6+
contents: read
7+
issues: read
8+
checks: write
9+
pull-requests: write
10+
on:
11+
pull_request:
12+
branches: [ "main" ]
13+
env:
14+
solutionPath: '${{ github.workspace }}/src/Dataverse.ConfigurationMigrationTool/Dataverse.ConfigurationMigrationTool.sln'
15+
xrmToolboxPath: 'src/Dataverse.ConfigurationMigrationTool/Dataverse.ConfigurationMigrationTool.XrmToolBox/Dataverse.ConfigurationMigrationTool.XrmToolBox.csproj'
16+
jobs:
17+
build:
18+
19+
runs-on: windows-latest
20+
21+
steps:
22+
- name: git configure long path
23+
run: git config --global core.longpaths true
24+
- uses: actions/checkout@v3
25+
- name: Setup .NET
26+
uses: actions/setup-dotnet@v3
27+
with:
28+
dotnet-version: 8.0.x
29+
30+
- name: Setup NuGet
31+
uses: nuget/setup-nuget@v1
32+
with:
33+
nuget-version: 'latest' # Or a specific version like '5.11.1'
34+
35+
- name: Add msbuild to PATH
36+
uses: microsoft/setup-msbuild@v2
37+
38+
- name: Restore NuGet packages
39+
run: nuget restore ${{ env.solutionPath }} # Replace with your solution file or project directory
40+
- name: Build xrmToolBox
41+
run: msbuild ${{ env.xrmToolboxPath }} -t:rebuild -verbosity:diag -property:Configuration=Release
42+
43+
44+
45+
46+
47+
48+
49+
50+

.github/workflows/ci-tag-release.yml

Lines changed: 80 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: Create Release on Tag
2+
23
on:
34
push:
45
# Sequence of patterns matched against refs/tags
@@ -10,10 +11,12 @@ env:
1011
solutionPath: '${{ github.workspace }}/src/Dataverse.ConfigurationMigrationTool/Dataverse.ConfigurationMigrationTool.sln'
1112
solutionFolder: '${{ github.workspace }}/src/Dataverse.ConfigurationMigrationTool'
1213
toolpublishlocation: '${{ github.workspace }}/configurationmigrationtool'
14+
xtbpublishlocation: '${{ github.workspace }}/xtb'
15+
xrmToolboxPath: 'src/Dataverse.ConfigurationMigrationTool/Dataverse.ConfigurationMigrationTool.XrmToolBox/Dataverse.ConfigurationMigrationTool.XrmToolBox.csproj'
1316
jobs:
1417

1518

16-
build:
19+
buildLinux:
1720

1821
runs-on: ubuntu-latest
1922

@@ -37,17 +40,72 @@ jobs:
3740
with:
3841
name: configurationmigrationtool
3942
path: ${{env.toolpublishlocation}}
43+
44+
buildwindows:
45+
46+
runs-on: windows-latest
47+
48+
steps:
49+
- name: git configure long path
50+
run: git config --global core.longpaths true
51+
- uses: actions/checkout@v4
52+
with:
53+
fetch-depth: 0
54+
- name: Install GitVersion
55+
uses: gittools/actions/gitversion/[email protected]
56+
with:
57+
versionSpec: '6.3.x'
58+
- name: Determine Version
59+
id: gitversion # step id used as reference for output values
60+
uses: gittools/actions/gitversion/[email protected]
61+
with:
62+
updateAssemblyInfo: true
63+
- name: Setup .NET
64+
uses: actions/setup-dotnet@v3
65+
with:
66+
dotnet-version: 8.0.x
67+
68+
- name: Setup NuGet
69+
uses: nuget/setup-nuget@v1
70+
with:
71+
nuget-version: 'latest' # Or a specific version like '5.11.1'
72+
73+
- name: Add msbuild to PATH
74+
uses: microsoft/setup-msbuild@v2
75+
76+
- name: Restore NuGet packages
77+
run: nuget restore ${{ env.solutionPath }} # Replace with your solution file or project directory
78+
- name: Build xrmToolBox
79+
run: msbuild ${{ env.xrmToolboxPath }} -t:rebuild -verbosity:diag -property:Configuration=Release
80+
81+
- name: Nuget Pack
82+
run: nuget pack src/Dataverse.ConfigurationMigrationTool/Dataverse.ConfigurationMigrationTool.XTB.nuspec -Version ${{ steps.gitversion.outputs.assemblySemFileVer }}
83+
- name: Create destination folder
84+
run: mkdir -p ${{env.xtbpublishlocation}}
85+
86+
- name: Copy files using wildcard
87+
run: cp *.nupkg ${{env.xtbpublishlocation}}
88+
- name: Upload tool artifact
89+
uses: actions/upload-artifact@v4
90+
with:
91+
name: configurationmigrationtool_xrmtoolbox
92+
path: ${{env.xtbpublishlocation}}
4093

4194
release:
4295
name: Create Release from tag
43-
needs: build
96+
needs: [ buildLinux, buildwindows]
4497
runs-on: ubuntu-latest
4598
steps:
46-
- name: Download tool artifact
99+
- name: Download clitool artifact
47100
uses: actions/download-artifact@v4
48101
with:
49102
name: configurationmigrationtool
50103
path: '${{ github.workspace }}/configurationmigrationtool'
104+
- name: Download xtbtool artifact
105+
uses: actions/download-artifact@v4
106+
with:
107+
name: configurationmigrationtool_xrmtoolbox
108+
path: '${{ env.xtbpublishlocation }}'
51109
- name: zip artifact # This would actually build your project, using zip for an example artifact
52110
run: |
53111
zip -r configurationmigrationtool${{ github.ref_name }}.zip configurationmigrationtool
@@ -61,7 +119,25 @@ jobs:
61119
release_name: Release ${{ github.ref }}
62120
draft: false
63121
prerelease: false
64-
- name: Upload Release Asset
122+
- name: Get nupkg path
123+
id: get_nupkg_path
124+
run: |
125+
NUPKG_PATH=$(ls ./xtb/*.nupkg | head -n 1)
126+
FILENAME=$(basename "$NUPKG_PATH")
127+
echo "nupkg_path=$NUPKG_PATH" >> "$GITHUB_OUTPUT"
128+
echo "filename=$FILENAME" >> "$GITHUB_OUTPUT" # Make it available to subsequent steps
129+
130+
- name: Upload NuGet Package Release Asset
131+
id: upload-nuget-release-asset
132+
uses: actions/upload-release-asset@v1
133+
env:
134+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
135+
with:
136+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
137+
asset_path: ${{ steps.get_nupkg_path.outputs.nupkg_path }}
138+
asset_name: ${{ steps.get_nupkg_path.outputs.filename }}
139+
asset_content_type: application/zip
140+
- name: Upload CLI Release Asset
65141
id: upload-release-asset
66142
uses: actions/upload-release-asset@v1
67143
env:
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Tag with GitVersion
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: write
8+
9+
jobs:
10+
tag:
11+
name: Create tag from GitVersion
12+
runs-on: ubuntu-latest
13+
# additional safety to ensure this runs for main branch only
14+
if: github.ref == 'refs/heads/main'
15+
steps:
16+
- name: Checkout repository (full history)
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Install GitVersion
22+
uses: gittools/actions/gitversion/[email protected]
23+
with:
24+
versionSpec: '6.3.x'
25+
- name: Determine Version
26+
id: gitversion # step id used as reference for output values
27+
uses: gittools/actions/gitversion/[email protected]
28+
29+
- name: Create and push annotated tag (minor+1, patch=0)
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
run: |
33+
set -euo pipefail
34+
MAJOR="${{ steps.gitversion.outputs.major }}"
35+
MINOR="${{ steps.gitversion.outputs.minor }}"
36+
# increment minor and set patch to 0
37+
NEW_MINOR=$((MINOR + 1))
38+
TAG="v${MAJOR}.${NEW_MINOR}.0"
39+
40+
git tag -a $TAG -m "Tag created by GitHub Actions using GitVersion (incremented minor)"
41+
git push origin $TAG
42+

GitVersion.yml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
assembly-versioning-scheme: MajorMinorPatch
2+
assembly-file-versioning-scheme: MajorMinorPatch
3+
tag-prefix: '[vV]?'
4+
version-in-branch-pattern: (?<version>[vV]?\d+(\.\d+)?(\.\d+)?).*
5+
major-version-bump-message: \+semver:\s?(breaking|major)
6+
minor-version-bump-message: \+semver:\s?(feature|minor)
7+
patch-version-bump-message: \+semver:\s?(fix|patch)
8+
no-bump-message: \+semver:\s?(none|skip)
9+
tag-pre-release-weight: 60000
10+
commit-date-format: yyyy-MM-dd
11+
merge-message-formats: {}
12+
update-build-number: true
13+
semantic-version-format: Strict
14+
strategies:
15+
- ConfiguredNextVersion
16+
- Mainline
17+
branches:
18+
main:
19+
mode: ContinuousDeployment
20+
label: ''
21+
increment: Patch
22+
prevent-increment:
23+
of-merged-branch: true
24+
track-merge-target: false
25+
track-merge-message: true
26+
regex: ^master$|^main$
27+
source-branches: []
28+
is-source-branch-for: []
29+
tracks-release-branches: false
30+
is-release-branch: false
31+
is-main-branch: true
32+
pre-release-weight: 55000
33+
feature:
34+
mode: ContinuousDelivery
35+
label: '{BranchName}'
36+
increment: Patch
37+
prevent-increment:
38+
when-current-commit-tagged: false
39+
track-merge-message: true
40+
regex: ^features?[\/-](?<BranchName>.+)
41+
source-branches:
42+
- main
43+
is-source-branch-for: []
44+
is-main-branch: false
45+
pre-release-weight: 30000
46+
hotfix:
47+
mode: ContinuousDelivery
48+
label: '{BranchName}'
49+
increment: Patch
50+
prevent-increment:
51+
when-current-commit-tagged: false
52+
regex: ^hotfix(es)?[\/-](?<BranchName>.+)
53+
source-branches:
54+
- main
55+
is-source-branch-for: []
56+
is-release-branch: true
57+
is-main-branch: false
58+
pre-release-weight: 30000
59+
pull-request:
60+
mode: ContinuousDelivery
61+
label: PullRequest{Number}
62+
increment: Inherit
63+
prevent-increment:
64+
of-merged-branch: true
65+
when-current-commit-tagged: false
66+
track-merge-message: true
67+
regex: ^(pull-requests|pull|pr)[\/-](?<Number>\d*)
68+
source-branches:
69+
- main
70+
- feature
71+
- hotfix
72+
is-source-branch-for: []
73+
pre-release-weight: 30000
74+
unknown:
75+
increment: Patch
76+
prevent-increment:
77+
when-current-commit-tagged: false
78+
regex: (?<BranchName>.+)
79+
source-branches:
80+
- main
81+
is-source-branch-for: []
82+
pre-release-weight: 30000
83+
ignore:
84+
sha: []
85+
paths: []
86+
mode: ContinuousDelivery
87+
label: '{BranchName}'
88+
increment: Inherit
89+
prevent-increment:
90+
of-merged-branch: false
91+
when-branch-merged: false
92+
when-current-commit-tagged: true
93+
track-merge-target: false
94+
track-merge-message: true
95+
commit-message-incrementing: Enabled
96+
regex: ''
97+
source-branches: []
98+
is-source-branch-for: []
99+
tracks-release-branches: false
100+
is-release-branch: false
101+
is-main-branch: false
2.91 KB
Loading

src/Dataverse.ConfigurationMigrationTool/Console.Tests/CodeCoverage.runsettings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<DataCollector friendlyName="XPlat code coverage">
66
<Configuration>
77
<Format>cobertura,opencover</Format>
8-
<Exclude>[*]Dataverse.ConfigurationMigrationTool.Console.Services.Dataverse.Connection.*,[*]Dataverse.ConfigurationMigrationTool.Console.Services.Dataverse.Configuration.*</Exclude>
8+
<Exclude>[*]Dataverse.ConfigurationMigrationTool.Console.Services.Dataverse.Connection.*,[*]Dataverse.ConfigurationMigrationTool.Console.Services.Dataverse.Configuration.*,[*]Dataverse.ConfigurationMigrationTool.XrmToolBox.*</Exclude>
99
<ExcludeByFile>**/Program.cs,**/IServiceCollectionExtensions.cs</ExcludeByFile>
1010
<SkipAutoProps>true</SkipAutoProps>
1111
</Configuration>

src/Dataverse.ConfigurationMigrationTool/Console.Tests/Features/Import/Validators/Rules/EntitySchemas/EntitySchemaValidatorTests.cs

Whitespace-only changes.

0 commit comments

Comments
 (0)