Skip to content

Commit

Permalink
Create NuGet packages on GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
devlead committed Jul 8, 2020
1 parent 1e26a31 commit c046612
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 18 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
jobs:
build:
name: Build
env:
TERM: xterm-256color
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -25,9 +27,20 @@ jobs:

- name: Build KuduSync.NET
run: |
dotnet build
dotnet build -p:Configuration=Release
- name: Test
- name: Test Windows
if: matrix.os == 'windows-latest'
shell: cmd
run: .\test.cmd

- name: Create NuGet Packages
if: matrix.os == 'windows-latest'
shell: cmd
run: .\BuildNugetPackages.cmd

- uses: actions/upload-artifact@v2
if: matrix.os == 'windows-latest'
with:
name: nupkg
path: artifacts
4 changes: 2 additions & 2 deletions BuildNugetPackages.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ set corefx="netcoreapp3.1"
set project=".\KuduSync.NET\KuduSync.NET.csproj"
set output=".\artifacts"

dotnet pack /p:TargetFramework=%corefx% /p:TargetFrameworks=%corefx% %project% --output "%output%"
dotnet pack /p:TargetFramework=%netfx% /p:TargetFrameworks=%netfx% %project% --output "%output%"
dotnet pack /p:Configuration=Release /p:TargetFramework=%corefx% /p:TargetFrameworks=%corefx% %project% --output "%output%"
dotnet pack /p:Configuration=Release /p:TargetFramework=%netfx% /p:TargetFrameworks=%netfx% %project% --output "%output%"
31 changes: 17 additions & 14 deletions KuduSync.NET/KuduSync.NET.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,28 @@
<Authors>amitap</Authors>
<PackageDescription>Tool for syncing files for deployment, will only copy changed files and delete files that doesn't exists in the destination but only if they were part of the previous deployment.</PackageDescription>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net45' ">
<IncludeBuildOutput>false</IncludeBuildOutput>
<NoWarn>NU5128</NoWarn>
<PackageId>$(AssemblyName)</PackageId>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
<PackAsTool>true</PackAsTool>
<PackageId>KuduSync.Tool</PackageId>
<ToolCommandName>kudusync</ToolCommandName>
<PackageDescription>.NET Global $(PackageDescription).</PackageDescription>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>full</DebugType>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.8.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
Expand All @@ -44,19 +60,6 @@
<Folder Include="images\" />
<None Include="../kudulogo.png" Link="images\kudulogo.png" Pack="true" PackagePath="/" />
<None Include="../LICENSE.txt" Pack="true" PackagePath="/" />
<None Include="bin\$(Configuration)\$(TargetFramework)\**" Exclude="bin\$(Configuration)\$(TargetFramework)\publish\**" Pack="true" PackagePath="/tools" Condition=" '$(TargetFramework)' == 'net45' " />
<None Include="bin/$(Configuration)/$(TargetFramework)/**" Exclude="bin/$(Configuration)/$(TargetFramework)/publish/**" Pack="true" PackagePath="/tools" Condition=" '$(TargetFramework)' == 'net45' " />
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net45' ">
<IncludeBuildOutput>false</IncludeBuildOutput>
<NoWarn>NU5128</NoWarn>
<PackageId>$(AssemblyName)</PackageId>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.1' ">
<PackAsTool>true</PackAsTool>
<PackageId>KuduSync.Tool</PackageId>
<ToolCommandName>kudusync</ToolCommandName>
<PackageDescription>.NET Global $(PackageDescription).</PackageDescription>
</PropertyGroup>
</Project>

0 comments on commit c046612

Please sign in to comment.