Skip to content

Commit

Permalink
Release release-v1.14.0
Browse files Browse the repository at this point in the history
***PUBLISH_RELEASE***
  • Loading branch information
nfbot authored Jul 2, 2020
2 parents a694210 + 8ba7359 commit a7ae3da
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 87 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![#yourfirstpr](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](https://github.com/nanoframework/Home/blob/master/CONTRIBUTING.md) [![Build Status](https://dev.azure.com/nanoframework/nano-firmware-flasher/_apis/build/status/nanoframework.nanoFirmwareFlasher?branchName=develop)](https://dev.azure.com/nanoframework/nano-firmware-flasher/_build/latest?definitionId=45&branchName=develop) [![NuGet](https://img.shields.io/nuget/v/nanoFirmwareFlasher.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFirmwareFlasher/) [![Discord](https://img.shields.io/discord/478725473862549535.svg?logo=discord&logoColor=white&label=Discord&color=7289DA)](https://discord.gg/gCyBu8T)
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![#yourfirstpr](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](https://github.com/nanoframework/Home/blob/master/CONTRIBUTING.md) [![Build Status](https://dev.azure.com/nanoframework/nanoFirmwareFlasher/_apis/build/status/nanoframework.nanoFirmwareFlasher?branchName=develop)](https://dev.azure.com/nanoframework/nanoFirmwareFlasher/_build/latest?definitionId=45&branchName=develop) [![NuGet](https://img.shields.io/nuget/v/nanoFirmwareFlasher.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFirmwareFlasher/) [![Discord](https://img.shields.io/discord/478725473862549535.svg?logo=discord&logoColor=white&label=Discord&color=7289DA)](https://discord.gg/gCyBu8T)

![nanoFramework logo](https://github.com/nanoframework/Home/blob/master/resources/logo/nanoFramework-repo-logo.png)

Expand Down Expand Up @@ -26,26 +26,26 @@ It makes use of several 3rd party tools:
Perform a one-time install of the **nanoFramework** Firmware Flasher tool using the following .NET Core CLI command:

```console
dotnet tool install -g nanoFirmwareFlasher
dotnet tool install -g nanoff
```

In case you're installing a pre-release version of the tool you have to specify the version number and the **nanoFramework** Azure DevOps NuGet feed as the source. Like this:

```console
dotnet tool install -g nanoFirmwareFlasher --version 9.9.9-preview.100 --add-source https://pkgs.dev.azure.com/nanoframework/feed/_packaging/sandbox/nuget/v3/index.json
dotnet tool install -g nanoff --version 9.9.9-preview.100 --add-source https://pkgs.dev.azure.com/nanoframework/feed/_packaging/sandbox/nuget/v3/index.json
```

After a successful installation a message is displayed showing the command that's to be used to call the tool along with the version installed. Similar to the following example:

```console
You can invoke the tool using the following command: nanoff
Tool 'nanofirmwareflasher' (version '9.9.9-preview.100') was successfully installed.
Tool 'nanoff' (version '9.9.9-preview.100') was successfully installed.
```

To update **nanoFramework** Firmware Flasher tool use the following .NET Core CLI command:

```console
dotnet tool update -g nanoFirmwareFlasher
dotnet tool update -g nanoff
```

## Usage
Expand Down
30 changes: 5 additions & 25 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ jobs:
command: push
nuGetFeedType: external
packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg'
publishFeedCredentials: 'AzureArtifacts-nano-firmware-flasher'
publishFeedCredentials: 'AzureArtifacts-nanoFirmwareFlasher'
condition: succeeded()
continueOnError: true
displayName: Push NuGet packages to AzureArtifacts
Expand All @@ -259,31 +259,11 @@ jobs:
nuGetFeedType: external
allowPackageConflicts: true
packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg'
publishFeedCredentials: 'NuGet-nano-firmware-flasher'
condition: and( succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v') )
publishFeedCredentials: 'NuGet-nanoFirmwareFlasher'
condition: and( succeeded(), ne(variables['Build.Reason'], 'PullRequest') )
continueOnError: true
displayName: Push NuGet packages to NuGet

# create or update GitHub release
- task: GitHubReleasePublish@1
inputs:
githubEndpoint: 'nanoFramework'
githubOwner: 'nanoframework'
githubRepositoryName: 'nanoFirmwareFlasher '
githubTag: v$(MY_NUGET_VERSION)
githubReleaseTitle: 'nano firmware flasher v$(MY_NUGET_VERSION)'
githubReleaseNotes: 'add description here'
githubTargetCommitsh: $(Build.SourceVersion)
githubReleaseDraft: $(RELEASE_DRAFT)
githubReleasePrerelease: true
githubReuseDraftOnly: true
githubReuseRelease: true
githubEditRelease: true
githubDeleteEmptyTag: true
githubReleaseAsset: '$(Build.ArtifactStagingDirectory)/*.nupkg'
condition: and( succeeded(), not( startsWith(variables['Build.SourceBranch'], 'refs/pull') ), not( startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ) )
displayName: Create/Update GitHub release

# create or update GitHub release ON tags from release or master branches
- task: GitHubReleasePublish@1
inputs:
Expand All @@ -294,14 +274,14 @@ jobs:
githubReleaseTitle: 'nano firmware flasher v$(MY_NUGET_VERSION)'
githubReleaseNotes: 'add description here'
githubTargetCommitsh: $(Build.SourceVersion)
githubReleaseDraft: $(RELEASE_DRAFT)
githubReleaseDraft: false
githubReleasePrerelease: true
githubReuseDraftOnly: false
githubReuseRelease: true
githubEditRelease: true
githubDeleteEmptyTag: true
githubReleaseAsset: '$(Build.ArtifactStagingDirectory)/*.nupkg'
condition: and( succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'), contains(variables['Build.SourceBranch'], 'preview') )
condition: and( succeeded(), ne(variables['Build.Reason'], 'PullRequest'), not( startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ) )
displayName: Create/Update GitHub PREVIEW release

# create or update GitHub release ON tags from release or master branches
Expand Down
36 changes: 0 additions & 36 deletions source/nanoFirmwareFlasher/Extensions/CommandLineExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,42 +19,6 @@ namespace nanoFramework.Tools.FirmwareFlasher.Extensions
{
public static class CommandLineExtensions
{
/// <summary>
/// Executes asynchronously <paramref name="action"/> if <see cref="CommandLine.ParserResult{T}"/> contains
/// parsed values.
/// </summary>
/// <typeparam name="T">Type of the target instance built with parsed value.</typeparam>
/// <param name="result">An <see cref="CommandLine.ParserResult{T}"/> instance.</param>
/// <param name="action">The <see cref="Func{T, Task}"/> to execute.</param>
/// <returns>The same <paramref name="result"/> instance as a <see cref="Task"/> instance.</returns>
public static async Task<ParserResult<T>> WithParsedAsync<T>(this ParserResult<T> result, Func<T, Task> action)
{
if (result is Parsed<T> parsed)
{
await action(parsed.Value);
}
return result;
}

//public static async Task<ParserResult<T>> WithNotParsedAsync<T>(this Task<ParserResult<T>> task, Action<IEnumerable<Error>> action)
//{
// var result = await task;
// if (result is NotParsed<T> notParsed)
// {
// return result.WithNotParsed(action);
// }
// return result;
//}

//public static async Task<ParserResult<T>> WithNotParsedAsync<T>(this ParserResult<T> result, Func<IEnumerable<Error>, Task> errorFunc)
//{
// if (result is NotParsed<T> notParsed)
// {
// await errorFunc(notParsed.Errors);
// }
// return result;
//}

/// <summary>
/// Async version of the WithNotParsed taking a Task as input for dot-appending to the WithParsedAsync extension method.
/// </summary>
Expand Down
5 changes: 5 additions & 0 deletions source/nanoFirmwareFlasher/FirmwarePackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ protected async System.Threading.Tasks.Task<ExitCodes> DownloadAndExtractAsync()

if (response.StatusCode == HttpStatusCode.NotFound)
{
if (Verbosity >= VerbosityLevel.Normal)
{
Console.WriteLine("");
}

// can't find this target
return ExitCodes.E9005;
}
Expand Down
1 change: 0 additions & 1 deletion source/nanoFirmwareFlasher/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ public class Options
/// diag[nostic]
/// </summary>
[Option(
'v',
"verbosity",
Required = false,
Default = "n",
Expand Down
39 changes: 23 additions & 16 deletions source/nanoFirmwareFlasher/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -771,31 +771,38 @@ private static void OutputError(ExitCodes errorCode, bool outputMessage, string
{
if (errorCode != ExitCodes.OK)
{
Console.Write($"Error {errorCode}");
}

if (outputMessage)
{
var exitCodeDisplayName = errorCode.GetAttribute<DisplayAttribute>();

if (!string.IsNullOrEmpty(exitCodeDisplayName.Name))
if (outputMessage)
{
Console.Write($": { exitCodeDisplayName.Name }");
Console.Write($"Error {errorCode}");
}
else
{
Console.Write($"{errorCode}");
}

if (string.IsNullOrEmpty(extraMessage))
if (outputMessage)
{
Console.WriteLine();
var exitCodeDisplayName = errorCode.GetAttribute<DisplayAttribute>();

if (!string.IsNullOrEmpty(exitCodeDisplayName.Name))
{
Console.Write($": { exitCodeDisplayName.Name }");
}

if (string.IsNullOrEmpty(extraMessage))
{
Console.WriteLine();
}
else
{
Console.WriteLine($" ({ extraMessage })");
}
}
else
{
Console.WriteLine($" ({ extraMessage })");
Console.WriteLine("");
}
}
else
{
Console.WriteLine("");
}
}
}
}
6 changes: 3 additions & 3 deletions source/nanoFirmwareFlasher/nanoFirmwareFlasher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<PropertyGroup Condition="'$(PackGlobalTool)' == true">
<PackAsTool>true</PackAsTool>
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
<PackageId>nanoFirmwareFlasher</PackageId>
<PackageId>nanoff</PackageId>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>

Expand All @@ -42,8 +42,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.7.82" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.0.50" PrivateAssets="All" />
<PackageReference Include="CommandLineParser" Version="2.8.0" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.1.91" PrivateAssets="All" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.7.0" />
<PackageReference Include="System.IO.Ports" Version="4.7.0" />
Expand Down
2 changes: 1 addition & 1 deletion source/version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "1.13.0",
"version": "1.14.0",
"assemblyVersion": {
"precision": "revision"
},
Expand Down

0 comments on commit a7ae3da

Please sign in to comment.