|
5 | 5 |
|
6 | 6 | jobs:
|
7 | 7 | 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 |
9 | 11 | 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 |
13 | 14 | with:
|
14 |
| - dotnet-version: 6.0.x |
15 |
| - - name: Restore dependencies |
16 |
| - run: dotnet restore |
| 15 | + ref: main |
17 | 16 | - 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 |
19 | 28 | - 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 |
37 | 41 | - name: Upload package
|
38 | 42 | uses: actions/upload-artifact@v3
|
39 | 43 | with:
|
|
0 commit comments