Skip to content

Commit

Permalink
Release prep (#27)
Browse files Browse the repository at this point in the history
* cleanup

* add debug symbols

* Adding source link support

* try move nuget to ados

* fix for nuget

* add code coverage
  • Loading branch information
ctolkien authored Apr 8, 2020
1 parent fa13b4b commit d389f2b
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 29 deletions.
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# TinyPng for .Net

| Platform | Status|
|---------|-------|
|Windows | [![Build status](https://img.shields.io/appveyor/ci/soda-digital/tinypng.svg?maxAge=2000)](https://ci.appveyor.com/project/Soda-Digital/tinypng) |
|Linux | [![Build Status](https://img.shields.io/travis/ctolkien/TinyPNG.svg?maxAge=2000)](https://travis-ci.org/ctolkien/TinyPNG) |

[![codecov](https://codecov.io/gh/ctolkien/TinyPNG/branch/master/graph/badge.svg)](https://codecov.io/gh/ctolkien/TinyPNG)
[![Build Status](https://dev.azure.com/chadtolkien/TinyPNG/_apis/build/status/ctolkien.TinyPNG?branchName=master)](https://dev.azure.com/chadtolkien/TinyPNG/_build/latest?definitionId=2&branchName=master)
![Version](https://img.shields.io/nuget/v/tinypng.svg?maxAge=2000)
[![license](https://img.shields.io/github/license/ctolkien/TinyPNG.svg?maxAge=2592000)]()

Expand Down Expand Up @@ -57,7 +52,7 @@ the extension methods now operate on `Task<T>`.
// they don't give you the actual bits (as you may want to chain this with a resize
// operation without caring for the originally sized image).
var compressImageTask = png.Compress("pathToFile or byte array or stream");
// or
// or `CompressFromUrl` if compressing from a remotely hosted image.
var compressFromUrlImageTask = png.CompressFromUrl("image url");

// If you want to actually save this compressed image off
Expand Down Expand Up @@ -122,7 +117,7 @@ depending on the type of resize you want to do.
var compressTask = png.Compress("pathToFile or byte array or stream");

await compressTask.Resize(new ScaleWidthResizeOperation(width));
await compressTask.Resize(new ScaleHeightResizeOperation(width));
await compressTask.Resize(new ScaleHeightResizeOperation(height));
await compressTask.Resize(new FitResizeOperation(width, height));
await compressTask.Resize(new CoverResizeOperation(width, height));
```
Expand Down
14 changes: 8 additions & 6 deletions TinyPNG.sln
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26403.7
# Visual Studio Version 16
VisualStudioVersion = 16.0.30002.166
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TinyPNG", "src\TinyPNG\TinyPNG.csproj", "{52901FDB-68CE-4192-8B2B-3BD1773261F3}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TinyPNG", "src\TinyPNG\TinyPNG.csproj", "{52901FDB-68CE-4192-8B2B-3BD1773261F3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TinyPng.Tests", "tests\TinyPng.Tests\TinyPng.Tests.csproj", "{DBA34C0E-C2A8-4D42-8770-FADC6251E93D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TinyPng.Tests", "tests\TinyPng.Tests\TinyPng.Tests.csproj", "{DBA34C0E-C2A8-4D42-8770-FADC6251E93D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{466E1CAF-57A2-4370-91C7-455AAC8E4D2E}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
.travis.yml = .travis.yml
appveyor.yml = appveyor.yml
azure-pipelines.yml = azure-pipelines.yml
README.md = README.md
EndProjectSection
EndProject
Expand All @@ -32,4 +31,7 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {54A4A777-ED82-4D34-A6E1-AACC3E946A40}
EndGlobalSection
EndGlobal
36 changes: 25 additions & 11 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
variables:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
BuildConfiguration: "Release"


DotNetVersion: 3.1.201
trigger:
- master
pr:
- master
jobs:
- job: "BuildWindows"
displayName: "Building .NET Application"
displayName: "Windows - Building .NET Application"
pool:
vmImage: 'windows-2019'
steps:
- task: DotNetCoreInstaller@1
displayName: "Use .NET Core sdk 3.1.201"
displayName: "Use .NET Core SDK"
inputs:
version: 3.1.201
version: $(DotNetVersion)
- task: DotNetCoreCLI@2
displayName: 'Test'
displayName: 'Test Windows'
inputs:
command: test

publishTestResults: true
codeCoverageEnabled: true
- task: DotNetCoreCLI@2
displayName: 'Pack'
inputs:
Expand All @@ -33,17 +32,32 @@ jobs:
targetPath: "$(build.artifactstagingdirectory)"
ArtifactName: "build"
- job: "BuildLinux"
displayName: "Building .NET Application"
displayName: "Linux - Building .NET Application"
pool:
vmImage: 'ubuntu-latest'
steps:
- task: DotNetCoreInstaller@1
displayName: "Use .NET Core sdk 3.1.201"
displayName: "Use .NET Core SDK"
inputs:
version: 3.1.201
version: $(DotNetVersion)
- task: DotNetCoreCLI@2
inputs:
command: build
displayName: 'Test Linux'
command: test
- task: DotNetCoreCLI@2
inputs:
command: build

- job: "NugetPublish"
dependsOn: "BuildWindows"
condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/release'))
displayName: "Publish to Nuget"
pool:
vmImage: 'ubuntu-latest'
steps:
- task: NuGetCommand@2
inputs:
command: 'push'
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
nuGetFeedType: 'external'
publishFeedCredentials: 'NuGet'
13 changes: 9 additions & 4 deletions src/TinyPNG/TinyPNG.csproj
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Copyright>Copyright 2016 Chad Tolkien</Copyright>
<Copyright>Copyright 2016 Chad Tolkien &amp; Contributors</Copyright>
<AssemblyTitle>TinyPNG</AssemblyTitle>
<VersionPrefix>3.2.0</VersionPrefix>
<VersionPrefix>3.3.0</VersionPrefix>
<Authors>Chad Tolkien</Authors>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<AssemblyName>TinyPNG</AssemblyName>
<PackageId>TinyPNG</PackageId>
<PackageTags>tinypng;images;compression;jpg;png</PackageTags>
<PackageReleaseNotes>Support for netstandard 2.0</PackageReleaseNotes>
<PackageIconUrl>https://raw.githubusercontent.com/ctolkien/TinyPNG/master/icon.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/ctolkien/TinyPNG</PackageProjectUrl>
<PackageLicenseUrl>http://opensource.org/licenses/MIT</PackageLicenseUrl>
<PackageReleaseNotes>
* 3.3 - Support for netstandard 2.0. Added compress from URL feature thanks to @d-ugarov
* 3.1 - Fixed bug to do with disposed HttpClient
</PackageReleaseNotes>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/ctolkien/TinyPNG</RepositoryUrl>
<DebugType>full</DebugType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />

<!-- Source link support-->
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
</ItemGroup>


Expand Down

0 comments on commit d389f2b

Please sign in to comment.