Skip to content

Commit 187b109

Browse files
committed
.
1 parent d8ebd21 commit 187b109

File tree

4 files changed

+152
-6
lines changed

4 files changed

+152
-6
lines changed

.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+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<package>
2+
<metadata>
3+
<id>Dataverse.ConfigurationMigrationTool.XrmToolBox</id>
4+
<version>1.0.0</version>
5+
<title>Configuration Migration Tool for XrmToolBox</title>
6+
<authors>François Desjardins-Nadeau</authors>
7+
<owners>dotnetprog</owners>
8+
<projectUrl>https://github.com/dotnetprog/dataverse-configuration-migration-tool</projectUrl>
9+
<iconUrl>https://github.com/dotnetprog/dataverse-configuration-migration-tool/blob/main/images/configurationmigrationtool_64.png?raw=true</iconUrl>
10+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
11+
<summary>Utility tool for migrating configuration data.</summary>
12+
<description>
13+
Utility tool that provides an easy way to migrate configuration data between Dataverse environments.
14+
</description>
15+
<releaseNotes>
16+
Full release notes:
17+
https://github.com/dotnetprog/dataverse-configuration-migration-tool/releases/latest
18+
</releaseNotes>
19+
<copyright>Copyright François Desjardins-Nadeau 2025</copyright>
20+
<tags>XrmToolBox Plugins Dataverse ConfigurationMigrationTool data export import</tags>
21+
<dependencies>
22+
<dependency id="XrmToolBox" version="1.2025.7.71" />
23+
</dependencies>
24+
</metadata>
25+
<files>
26+
<file src="Dataverse.ConfigurationMigrationTool.XrmToolBox\bin\Release\Dataverse.ConfigurationMigrationTool.XrmToolBox.dll" target="lib\net48\Plugins" />
27+
</files>
28+
</package>

src/Dataverse.ConfigurationMigrationTool/Dataverse.ConfigurationMigrationTool.XrmToolBox/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@
2929
// Revision
3030
//
3131

32-
[assembly: AssemblyVersion("1.1.2.0")]
33-
[assembly: AssemblyFileVersion("1.1.2.0")]
32+
[assembly: AssemblyVersion("1.0.0.0")]
33+
[assembly: AssemblyFileVersion("1.0.0.0")]
3434
[assembly: AssemblyInformationalVersion("1.1.2-AddXrmtoolBox.0+Branch.feature-AddXrmtoolBox.Sha.e4430db29230de99c44c859669fd6b06ef375737")]

0 commit comments

Comments
 (0)