Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting up continuous delivery of packages to nuget #62

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
35 changes: 30 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,36 @@
language: csharp
solution: csharp-rest-client.sln
mono: none
dotnet: 2.1.300
script:
- cd Tests/UnitTests/MessageBirdUnitTests
- dotnet restore
- dotnet test
sudo: required
dist: xenial
dotnet: 2.2
env:
- VERSION=1.6.1
global:
secure: dW4i1leTDXh38v7756n1XCC/l9FokZDmOlwjSdYD89BcgGsJzHh/g/K/9IISUhNw9ZXqs2GRGsHGUd4BnZ/dkju+9eyR9VvYBB6h9UfFxKk3+lLbIiWnIUpKzlqrmErpyoEr7tGtqk1JR4+rgRy/CP7giS9uCV2SlX+kntGz60bkrX2308n5PMidCjg9o6DeLnmpDO8+joAUBi2+v3/648+6pk9OIiFJqrYjj90fH+YlF+3vPYugS6arbSiRQ5lfn8lHWqfIuCzikHcjA3/MVeVqrXuYINtWz0xF03/n107Wrl00FtrRnXcp2ssixXZ1u6is9zJFvRewoKjxTSN3VjQIev9h+HTSBoua5KQdcbZ6Of2+f8SiC6lXvAz436OxOqyO7z11urHLBk/ZL+1iX5Qkh+9Aq+ZhdHsbufnZMzfgzx3MLRhrsgK0aJk+gnAOSqci7a/bZlkuGUlru4cN0jR/aP2+tIAM+beRwo0e0eTEHxy4wnKDs00sJnY0nOpq/K7zRqRuq/3DXkGq9+/8TzyiCp9mJ+z4lXzZfJWybmcaTnXKJqzcN1GmVV1UaGfEz0SZWRiJ28XTLyZkxpXRUN+n+zYJNGlonzFub92y0Q0v4td2NVuzIi2WNcC1G1MJJUr3DZ16/0D5QU6589O6JoVjhD31Diw7oK0ig+YedgY=
stages:
- name: test
- name: check
- name: deploy
if: "(branch = master) AND (NOT (type IN (push, pull_request)))"
jobs:
include:
- stage: test
script:
- cd Tests/UnitTests/MessageBirdUnitTests
- dotnet restore
- dotnet test
- stage: check
script:
- pwd
- ls
- stage: deploy
script:
- test "$(curl -I https://globalcdn.nuget.org/packages/messagebird.$VERSION.nupkg
| head -n1 | awk '{print $2}')" -eq 200 && echo "package with version $VERSION
already exists" && exit 0 || echo "Packing and uploading ..."
- cd MessageBird
- dotnet restore
- dotnet build
- dotnet pack -p:PackageID=MessageBird -c Release -p:PackageVersion=$VERSION
- dotnet nuget push bin/Release/MessageBird.$VERSION.nupkg -k $LIVE_KEY -s https://api.nuget.org/v3/index.json
14 changes: 8 additions & 6 deletions MessageBird/MessageBird.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net40;netstandard2.0</TargetFrameworks>
<TargetFrameworks>netcoreapp2.2</TargetFrameworks>
<Product>MessageBird</Product>
<Title>MessageBird</Title>
<Company>MessageBird</Company>
Expand All @@ -12,11 +12,13 @@
<LangVersion>4</LangVersion>
</PropertyGroup>

<!-- Conditionally obtain references for the .NET Framework 4.0 target -->
<ItemGroup Condition=" '$(TargetFramework)' == 'net40' ">
</ItemGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<LangVersion>default</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<LangVersion>default</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<LangVersion>default</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<LangVersion>default</LangVersion>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\MessageBird\MessageBird.csproj" />
</ItemGroup>
Expand Down