Skip to content

Commit 96d2827

Browse files
authored
Merge pull request #28 from AzureCosmosDB/develop
Promote Release build / NuGet tool packaging
2 parents bc17cfa + 6774a47 commit 96d2827

File tree

16 files changed

+126
-65
lines changed

16 files changed

+126
-65
lines changed

.github/actions/build-with-plugins/action.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ runs:
1818
run: |
1919
dotnet publish \
2020
Core/Cosmos.DataTransfer.Core/Cosmos.DataTransfer.Core.csproj \
21-
--configuration release \
21+
--configuration Release \
2222
--output ${{ inputs.platform-short }} \
2323
--self-contained true \
2424
--runtime ${{ inputs.runtime }} \
@@ -33,7 +33,7 @@ runs:
3333
run: |
3434
dotnet publish \
3535
Extensions/Cosmos/Cosmos.DataTransfer.CosmosExtension/Cosmos.DataTransfer.CosmosExtension.csproj \
36-
--configuration release \
36+
--configuration Release \
3737
--output ${{ inputs.platform-short }}/Extensions \
3838
--self-contained false \
3939
--runtime ${{ inputs.runtime }} \
@@ -48,7 +48,7 @@ runs:
4848
run: |
4949
dotnet publish \
5050
Extensions/Json/Cosmos.DataTransfer.JsonExtension/Cosmos.DataTransfer.JsonExtension.csproj \
51-
--configuration release \
51+
--configuration Release \
5252
--output ${{ inputs.platform-short }}/Extensions \
5353
--self-contained false \
5454
--runtime ${{ inputs.runtime }} \
@@ -63,7 +63,7 @@ runs:
6363
run: |
6464
dotnet publish \
6565
Extensions/AzureTableAPI/Cosmos.DataTransfer.AzureTableAPIExtension/Cosmos.DataTransfer.AzureTableAPIExtension.csproj \
66-
--configuration release \
66+
--configuration Release \
6767
--output ${{ inputs.platform-short }}/Extensions \
6868
--self-contained false \
6969
--runtime ${{ inputs.runtime }} \
@@ -78,7 +78,7 @@ runs:
7878
run: |
7979
dotnet publish \
8080
Extensions/Mongo/Cosmos.DataTransfer.MongoExtension/Cosmos.DataTransfer.MongoExtension.csproj \
81-
--configuration release \
81+
--configuration Release \
8282
--output ${{ inputs.platform-short }}/Extensions \
8383
--self-contained false \
8484
--runtime ${{ inputs.runtime }} \
@@ -93,7 +93,7 @@ runs:
9393
run: |
9494
dotnet publish \
9595
Extensions/SqlServer/Cosmos.DataTransfer.SqlServerExtension/Cosmos.DataTransfer.SqlServerExtension.csproj \
96-
--configuration release \
96+
--configuration Release \
9797
--output ${{ inputs.platform-short }}/Extensions \
9898
--self-contained false \
9999
--runtime ${{ inputs.runtime }} \

.github/workflows/deploy_tool_nupkg.yml

+29-25
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,39 @@ on:
55

66
jobs:
77
build:
8-
runs-on: windows-latest
8+
name: Create dotnet tool NuGet package
9+
runs-on: ubuntu-latest
10+
container: mcr.microsoft.com/dotnet/sdk:6.0
911
steps:
10-
- uses: actions/checkout@v3
11-
- name: Setup .NET
12-
uses: actions/setup-dotnet@v2
12+
- name: Check out repository
13+
uses: actions/checkout@v3
1314
with:
14-
dotnet-version: 6.0.x
15-
- name: Restore dependencies
16-
run: dotnet restore
15+
ref: main
1716
- name: Build
18-
run: dotnet build CosmosDbDataMigrationTool.sln --configuration Release --no-restore --no-incremental
17+
run: dotnet build CosmosDbDataMigrationTool.sln --configuration Release --no-incremental
18+
- name: Publish extensions (AzureTableAPI)
19+
run: dotnet publish Extensions/AzureTableAPI/Cosmos.DataTransfer.AzureTableAPIExtension/Cosmos.DataTransfer.AzureTableAPIExtension.csproj --configuration Release --no-build -p:PublishProfile=PublishToExtensionsFolder
20+
- name: Publish extensions (Cosmos)
21+
run: dotnet publish Extensions/Cosmos/Cosmos.DataTransfer.CosmosExtension/Cosmos.DataTransfer.CosmosExtension.csproj --configuration Release --no-build -p:PublishProfile=PublishToExtensionsFolder
22+
- name: Publish extensions (Json)
23+
run: dotnet publish Extensions/Json/Cosmos.DataTransfer.JsonExtension/Cosmos.DataTransfer.JsonExtension.csproj --configuration Release --no-build -p:PublishProfile=PublishToExtensionsFolder
24+
- name: Publish extensions (Mongo)
25+
run: dotnet publish Extensions/Mongo/Cosmos.DataTransfer.MongoExtension/Cosmos.DataTransfer.MongoExtension.csproj --configuration Release --no-build -p:PublishProfile=PublishToExtensionsFolder
26+
- name: Publish extensions (SQL Server)
27+
run: dotnet publish Extensions/SqlServer/Cosmos.DataTransfer.SqlServerExtension/Cosmos.DataTransfer.SqlServerExtension.csproj --configuration Release --no-build -p:PublishProfile=PublishToExtensionsFolder
1928
- name: Create NuGet Package
20-
run: dotnet pack Core/Cosmos.DataTransfer.Core/Cosmos.DataTransfer.Core.csproj
21-
- name: Add Extensions folder into the NuGet package
22-
uses: azure/powershell@v1
23-
with:
24-
inlineScript: |
25-
cd .\Core\Cosmos.DataTransfer.Core\bin\Release
26-
$pkg = Get-ChildItem './' -Filter '*.nupkg'
27-
$fileName = $pkg.Name
28-
Rename-Item -Path $fileName -NewName "$($fileName).zip"
29-
Expand-Archive -Path "$($fileName).zip" -DestinationPath $fileName.Split('.')[0]
30-
Copy-Item "./net6.0/Extensions" -Destination "./$($fileName.Split('.')[0])/tools/net6.0/any/Extensions" -Recurse
31-
Compress-Archive -Path "$($fileName.Split('.')[0])\*" -DestinationPath "$($fileName).zip" -Force
32-
Rename-Item -Path "$($fileName).zip" -NewName $fileName
33-
cd..
34-
cd..
35-
cd..
36-
cd..
29+
run: dotnet pack Core/Cosmos.DataTransfer.Core/Cosmos.DataTransfer.Core.csproj --configuration Release --no-build
30+
- name: Add extensions to package
31+
run: |
32+
cd .\Core\Cosmos.DataTransfer.Core\bin\Release
33+
$pkg = Get-ChildItem './' -Filter '*.nupkg'
34+
$fileName = $pkg.Name
35+
Rename-Item -Path $fileName -NewName "$($fileName).zip"
36+
Expand-Archive -Path "$($fileName).zip" -DestinationPath $fileName.Split('.')[0]
37+
Copy-Item "./net6.0/Extensions" -Destination "./$($fileName.Split('.')[0])/tools/net6.0/any/Extensions" -Recurse
38+
Compress-Archive -Path "$($fileName.Split('.')[0])\*" -DestinationPath "$($fileName).zip" -Force
39+
Rename-Item -Path "$($fileName).zip" -NewName $fileName
40+
shell: pwsh
3741
- name: Upload package
3842
uses: actions/upload-artifact@v3
3943
with:

.github/workflows/release.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ jobs:
2424
with:
2525
name: linux-package
2626
path: linux-package
27-
- name: Rename output files
27+
- name: Package output files
2828
run: |
29-
mv windows-package dmt-${{ github.ref_name }}-win-x64.zip
30-
mv mac-package dmt-${{ github.ref_name }}-mac-x64.zip
31-
mv linux-package dmt-${{ github.ref_name }}-linux-x64.zip
29+
zip -r dmt-${{ github.ref_name }}-win-x64.zip windows-package/*
30+
zip -r dmt-${{ github.ref_name }}-mac-x64.zip mac-package/*
31+
zip -r dmt-${{ github.ref_name }}-linux-x64.zip linux-package/*
3232
- name: Create GitHub release
3333
uses: softprops/action-gh-release@v1
3434
with:

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ publish/
218218
*.azurePubxml
219219
# Note: Comment the next line if you want to checkin your web deploy settings,
220220
# but database connection strings (with potential passwords) will be unencrypted
221-
*.pubxml
221+
#*.pubxml
222222
*.publishproj
223223

224224
# Microsoft Azure Web App publish settings. Comment the next line if you want to

Core/Cosmos.DataTransfer.Core/Cosmos.DataTransfer.Core.csproj

+9-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,16 @@
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
<UserSecretsId>c7432a3a-5dc1-4e86-a1f0-b2363bf5c77f</UserSecretsId>
9-
<PackageId>datatransfer-core</PackageId>
9+
<PackageId>cosmos-db-desktop-data-migration-tool</PackageId>
1010
<AssemblyName>dmt</AssemblyName>
11+
<Title>Cosmos DB Desktop Data Migration Tool</Title>
12+
<PackageProjectUrl>https://github.com/AzureCosmosDB/data-migration-desktop-tool</PackageProjectUrl>
13+
<RepositoryUrl>https://github.com/AzureCosmosDB/data-migration-desktop-tool</RepositoryUrl>
14+
<RepositoryType>git</RepositoryType>
15+
<PackAsTool>True</PackAsTool>
16+
<PackageVersion>2.0.0</PackageVersion>
17+
<PackageReleaseNotes>Initial release</PackageReleaseNotes>
18+
<Description>The Azure Cosmos DB Desktop Data Migration Tool is an extensible command-line application that simplifies moving data into and out of Azure Cosmos DB.</Description>
1119
</PropertyGroup>
1220

1321
<ItemGroup>

Extensions/AzureTableAPI/Cosmos.DataTransfer.AzureTableAPIExtension/Cosmos.DataTransfer.AzureTableAPIExtension.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
<ProjectReference Include="..\..\..\Interfaces\Cosmos.DataTransfer.Interfaces\Cosmos.DataTransfer.Interfaces.csproj" />
1818
</ItemGroup>
1919

20-
<Target Name="PublishDebug" AfterTargets="Build" Condition=" '$(Configuration)' == 'Debug' ">
21-
<Exec Command="dotnet publish --no-build -p:PublishProfile=LocalDebugFolder" />
20+
<Target Name="PublishToExtensionsFolder" AfterTargets="Build" Condition=" '$(Configuration)' == 'Debug' ">
21+
<Exec Command="dotnet publish --configuration $(Configuration) --no-build -p:PublishProfile=PublishToExtensionsFolder" />
2222
</Target>
2323

2424
</Project>

Extensions/AzureTableAPI/Cosmos.DataTransfer.AzureTableAPIExtension/Properties/PublishProfiles/LocalDebugFolder.pubxml Extensions/AzureTableAPI/Cosmos.DataTransfer.AzureTableAPIExtension/Properties/PublishProfiles/PublishToExtensionsFolder.pubxml

+9
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,13 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
1212
<TargetFramework>net6.0</TargetFramework>
1313
<SelfContained>false</SelfContained>
1414
</PropertyGroup>
15+
<PropertyGroup>
16+
<Configuration>Release</Configuration>
17+
<Platform>Any CPU</Platform>
18+
<PublishDir>..\..\..\Core\Cosmos.DataTransfer.Core\bin\Release\net6.0\Extensions</PublishDir>
19+
<PublishProtocol>FileSystem</PublishProtocol>
20+
<_TargetId>Folder</_TargetId>
21+
<TargetFramework>net6.0</TargetFramework>
22+
<SelfContained>false</SelfContained>
23+
</PropertyGroup>
1524
</Project>

Extensions/Cosmos/Cosmos.DataTransfer.CosmosExtension/Cosmos.DataTransfer.CosmosExtension.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<ProjectReference Include="..\..\..\Interfaces\Cosmos.DataTransfer.Interfaces\Cosmos.DataTransfer.Interfaces.csproj" />
2323
</ItemGroup>
2424

25-
<Target Name="PublishDebug" AfterTargets="Build" Condition=" '$(Configuration)' == 'Debug' ">
26-
<Exec Command="dotnet publish --no-build -p:PublishProfile=LocalDebugFolder" />
25+
<Target Name="PublishToExtensionsFolder" AfterTargets="Build" Condition=" '$(Configuration)' == 'Debug' ">
26+
<Exec Command="dotnet publish --configuration $(Configuration) --no-build -p:PublishProfile=PublishToExtensionsFolder" />
2727
</Target>
2828
</Project>

Extensions/Cosmos/Cosmos.DataTransfer.CosmosExtension/Properties/PublishProfiles/LocalDebugFolder.pubxml Extensions/Cosmos/Cosmos.DataTransfer.CosmosExtension/Properties/PublishProfiles/PublishToExtensionsFolder.pubxml

+9
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,13 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
1212
<TargetFramework>net6.0</TargetFramework>
1313
<SelfContained>false</SelfContained>
1414
</PropertyGroup>
15+
<PropertyGroup>
16+
<Configuration>Release</Configuration>
17+
<Platform>Any CPU</Platform>
18+
<PublishDir>..\..\..\Core\Cosmos.DataTransfer.Core\bin\Release\net6.0\Extensions</PublishDir>
19+
<PublishProtocol>FileSystem</PublishProtocol>
20+
<_TargetId>Folder</_TargetId>
21+
<TargetFramework>net6.0</TargetFramework>
22+
<SelfContained>false</SelfContained>
23+
</PropertyGroup>
1524
</Project>

Extensions/Json/Cosmos.DataTransfer.JsonExtension/Cosmos.DataTransfer.JsonExtension.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
<ProjectReference Include="..\..\..\Interfaces\Cosmos.DataTransfer.Interfaces\Cosmos.DataTransfer.Interfaces.csproj" />
1717
</ItemGroup>
1818

19-
<Target Name="PublishDebug" AfterTargets="Build" Condition=" '$(Configuration)' == 'Debug' ">
20-
<Exec Command="dotnet publish --no-build -p:PublishProfile=LocalDebugFolder" />
19+
<Target Name="PublishToExtensionsFolder" AfterTargets="Build" Condition=" '$(Configuration)' == 'Debug' ">
20+
<Exec Command="dotnet publish --configuration $(Configuration) --no-build -p:PublishProfile=PublishToExtensionsFolder" />
2121
</Target>
2222

2323
</Project>

Extensions/Json/Cosmos.DataTransfer.JsonExtension/Properties/PublishProfiles/LocalDebugFolder.pubxml Extensions/Json/Cosmos.DataTransfer.JsonExtension/Properties/PublishProfiles/PublishToExtensionsFolder.pubxml

+9
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,13 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
1212
<TargetFramework>net6.0</TargetFramework>
1313
<SelfContained>false</SelfContained>
1414
</PropertyGroup>
15+
<PropertyGroup>
16+
<Configuration>Release</Configuration>
17+
<Platform>Any CPU</Platform>
18+
<PublishDir>..\..\..\Core\Cosmos.DataTransfer.Core\bin\Release\net6.0\Extensions</PublishDir>
19+
<PublishProtocol>FileSystem</PublishProtocol>
20+
<_TargetId>Folder</_TargetId>
21+
<TargetFramework>net6.0</TargetFramework>
22+
<SelfContained>false</SelfContained>
23+
</PropertyGroup>
1524
</Project>

Extensions/Mongo/Cosmos.DataTransfer.MongoExtension/Cosmos.DataTransfer.MongoExtension.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFramework>net6.0</TargetFramework>
@@ -17,8 +17,8 @@
1717
<ProjectReference Include="..\..\..\Interfaces\Cosmos.DataTransfer.Interfaces\Cosmos.DataTransfer.Interfaces.csproj" />
1818
</ItemGroup>
1919

20-
<Target Name="PublishDebug" AfterTargets="Build" Condition=" '$(Configuration)' == 'Debug' ">
21-
<Exec Command="dotnet publish --no-build -p:PublishProfile=LocalDebugFolder" />
20+
<Target Name="PublishToExtensionsFolder" AfterTargets="Build" Condition=" '$(Configuration)' == 'Debug' ">
21+
<Exec Command="dotnet publish --configuration $(Configuration) --no-build -p:PublishProfile=PublishToExtensionsFolder" />
2222
</Target>
2323

2424
</Project>

Extensions/Mongo/Cosmos.DataTransfer.MongoExtension/Properties/PublishProfiles/LocalDebugFolder.pubxml Extensions/Mongo/Cosmos.DataTransfer.MongoExtension/Properties/PublishProfiles/PublishToExtensionsFolder.pubxml

+9
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,13 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
1212
<TargetFramework>net6.0</TargetFramework>
1313
<SelfContained>false</SelfContained>
1414
</PropertyGroup>
15+
<PropertyGroup>
16+
<Configuration>Release</Configuration>
17+
<Platform>Any CPU</Platform>
18+
<PublishDir>..\..\..\Core\Cosmos.DataTransfer.Core\bin\Release\net6.0\Extensions</PublishDir>
19+
<PublishProtocol>FileSystem</PublishProtocol>
20+
<_TargetId>Folder</_TargetId>
21+
<TargetFramework>net6.0</TargetFramework>
22+
<SelfContained>false</SelfContained>
23+
</PropertyGroup>
1524
</Project>

Extensions/SqlServer/Cosmos.DataTransfer.SqlServerExtension/Cosmos.DataTransfer.SqlServerExtension.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<ProjectReference Include="..\..\..\Interfaces\Cosmos.DataTransfer.Interfaces\Cosmos.DataTransfer.Interfaces.csproj" />
2222
</ItemGroup>
2323

24-
<Target Name="PublishDebug" AfterTargets="Build" Condition=" '$(Configuration)' == 'Debug' ">
25-
<Exec Command="dotnet publish --no-build -p:PublishProfile=LocalDebugFolder" />
24+
<Target Name="PublishToExtensionsFolder" AfterTargets="Build" Condition=" '$(Configuration)' == 'Debug' ">
25+
<Exec Command="dotnet publish --configuration $(Configuration) --no-build -p:PublishProfile=PublishToExtensionsFolder" />
2626
</Target>
2727
</Project>

Extensions/SqlServer/Cosmos.DataTransfer.SqlServerExtension/Properties/PublishProfiles/LocalDebugFolder.pubxml Extensions/SqlServer/Cosmos.DataTransfer.SqlServerExtension/Properties/PublishProfiles/PublishToExtensionsFolder.pubxml

+9
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,13 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
1212
<TargetFramework>net6.0</TargetFramework>
1313
<SelfContained>false</SelfContained>
1414
</PropertyGroup>
15+
<PropertyGroup>
16+
<Configuration>Release</Configuration>
17+
<Platform>Any CPU</Platform>
18+
<PublishDir>..\..\..\Core\Cosmos.DataTransfer.Core\bin\Release\net6.0\Extensions</PublishDir>
19+
<PublishProtocol>FileSystem</PublishProtocol>
20+
<_TargetId>Folder</_TargetId>
21+
<TargetFramework>net6.0</TargetFramework>
22+
<SelfContained>false</SelfContained>
23+
</PropertyGroup>
1524
</Project>

README.md

+21-17
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ To access the archived version of the tool, navigate to the [**Archive branch**]
55
---
66

77
- [Azure Cosmos DB Desktop Data Migration Tool](#azure-cosmos-db-desktop-data-migration-tool)
8-
- [Architecture](#Azure-Cosmos-DB-Desktop-Data-Migration-Tool-architecture)
9-
- [Project Structure](#cosmos-db-project-structure)
8+
- [Overview](#overview)
9+
- [Extension documentation](#extension-documentation)
10+
- [Architecture](#architecture)
11+
- [Project Structure](#project-structure)
1012
- [Getting Started](#getting-started)
1113
- [Clone the source code repository](#clone-the-source-code-repository)
1214
- [Build the solution](#build-the-solution)
@@ -17,8 +19,24 @@ To access the archived version of the tool, navigate to the [**Archive branch**]
1719
- [Task 3: Setup the data migration configuration](#task-3-setup-the-data-migration-configuration)
1820
- [Using the command line](#using-the-command-line)
1921
- [Creating Extensions](#creating-extensions)
20-
- [Extension documentation](#extension-documentation)
2122

23+
## Overview
24+
25+
The Azure Cosmos DB Desktop Data Migration Tool is an open-source project containing a command-line application that provides import and export functionality for Azure Cosmos DB.
26+
27+
## Extension documentation
28+
29+
Multiple extensions are provided in this repository. Find the documentation for the usage and configuration of each using the links provided:
30+
31+
1. [Azure Cosmos DB](Extensions/Cosmos/README.md)
32+
33+
2. [Azure Table API](Extensions/AzureTableAPI/README.md)
34+
35+
3. [JSON](Extensions/Json/README.md)
36+
37+
4. [MongoDB](Extensions/Mongo/README.md)
38+
39+
5. [SQL Server](Extensions/SqlServer/README.md)
2240

2341
## Architecture
2442

@@ -183,17 +201,3 @@ This tutorial outlines how to use the Azure Cosmos DB Desktop Data Migration Too
183201
7. Settings needed by the extension can be retrieved from any standard .NET configuration source in the main application by using the `IConfiguration` instance passed into the `ReadAsync` and `WriteAsync` methods. Settings under `SourceSettings`/`SinkSettings` will be included as well as any settings included in JSON files specified by the `SourceSettingsPath`/`SinkSettingsPath`.
184202

185203
8. Implement your extension to read and/or write using the generic `IDataItem` interface which exposes object properties as a list key-value pairs. Depending on the specific structure of the data storage type being implemented, you can choose to support nested objects and arrays or only flat top-level properties.
186-
187-
## Extension documentation
188-
189-
Multiple extensions are provided in this repository. Find the documentation for the usage and configuration of each using the links provided:
190-
191-
1. [Azure Cosmos DB](Extensions/Cosmos/README.md)
192-
193-
2. [Azure Table API](Extensions/AzureTableAPI/README.md)
194-
195-
3. [JSON](Extensions/Json/README.md)
196-
197-
4. [MongoDB](Extensions/Mongo/README.md)
198-
199-
5. [SQL Server](Extensions/SqlServer/README.md)

0 commit comments

Comments
 (0)