Skip to content

Commit a7ae3da

Browse files
authored
Release release-v1.14.0
***PUBLISH_RELEASE***
2 parents a694210 + 8ba7359 commit a7ae3da

File tree

8 files changed

+42
-87
lines changed

8 files changed

+42
-87
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![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)
1+
[![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)
22

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

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

2828
```console
29-
dotnet tool install -g nanoFirmwareFlasher
29+
dotnet tool install -g nanoff
3030
```
3131

3232
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:
3333

3434
```console
35-
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
35+
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
3636
```
3737

3838
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:
3939

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

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

4747
```console
48-
dotnet tool update -g nanoFirmwareFlasher
48+
dotnet tool update -g nanoff
4949
```
5050

5151
## Usage

azure-pipelines.yml

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ jobs:
247247
command: push
248248
nuGetFeedType: external
249249
packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg'
250-
publishFeedCredentials: 'AzureArtifacts-nano-firmware-flasher'
250+
publishFeedCredentials: 'AzureArtifacts-nanoFirmwareFlasher'
251251
condition: succeeded()
252252
continueOnError: true
253253
displayName: Push NuGet packages to AzureArtifacts
@@ -259,31 +259,11 @@ jobs:
259259
nuGetFeedType: external
260260
allowPackageConflicts: true
261261
packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg'
262-
publishFeedCredentials: 'NuGet-nano-firmware-flasher'
263-
condition: and( succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v') )
262+
publishFeedCredentials: 'NuGet-nanoFirmwareFlasher'
263+
condition: and( succeeded(), ne(variables['Build.Reason'], 'PullRequest') )
264264
continueOnError: true
265265
displayName: Push NuGet packages to NuGet
266266

267-
# create or update GitHub release
268-
- task: GitHubReleasePublish@1
269-
inputs:
270-
githubEndpoint: 'nanoFramework'
271-
githubOwner: 'nanoframework'
272-
githubRepositoryName: 'nanoFirmwareFlasher '
273-
githubTag: v$(MY_NUGET_VERSION)
274-
githubReleaseTitle: 'nano firmware flasher v$(MY_NUGET_VERSION)'
275-
githubReleaseNotes: 'add description here'
276-
githubTargetCommitsh: $(Build.SourceVersion)
277-
githubReleaseDraft: $(RELEASE_DRAFT)
278-
githubReleasePrerelease: true
279-
githubReuseDraftOnly: true
280-
githubReuseRelease: true
281-
githubEditRelease: true
282-
githubDeleteEmptyTag: true
283-
githubReleaseAsset: '$(Build.ArtifactStagingDirectory)/*.nupkg'
284-
condition: and( succeeded(), not( startsWith(variables['Build.SourceBranch'], 'refs/pull') ), not( startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ) )
285-
displayName: Create/Update GitHub release
286-
287267
# create or update GitHub release ON tags from release or master branches
288268
- task: GitHubReleasePublish@1
289269
inputs:
@@ -294,14 +274,14 @@ jobs:
294274
githubReleaseTitle: 'nano firmware flasher v$(MY_NUGET_VERSION)'
295275
githubReleaseNotes: 'add description here'
296276
githubTargetCommitsh: $(Build.SourceVersion)
297-
githubReleaseDraft: $(RELEASE_DRAFT)
277+
githubReleaseDraft: false
298278
githubReleasePrerelease: true
299279
githubReuseDraftOnly: false
300280
githubReuseRelease: true
301281
githubEditRelease: true
302282
githubDeleteEmptyTag: true
303283
githubReleaseAsset: '$(Build.ArtifactStagingDirectory)/*.nupkg'
304-
condition: and( succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'), contains(variables['Build.SourceBranch'], 'preview') )
284+
condition: and( succeeded(), ne(variables['Build.Reason'], 'PullRequest'), not( startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ) )
305285
displayName: Create/Update GitHub PREVIEW release
306286

307287
# create or update GitHub release ON tags from release or master branches

source/nanoFirmwareFlasher/Extensions/CommandLineExtensions.cs

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -19,42 +19,6 @@ namespace nanoFramework.Tools.FirmwareFlasher.Extensions
1919
{
2020
public static class CommandLineExtensions
2121
{
22-
/// <summary>
23-
/// Executes asynchronously <paramref name="action"/> if <see cref="CommandLine.ParserResult{T}"/> contains
24-
/// parsed values.
25-
/// </summary>
26-
/// <typeparam name="T">Type of the target instance built with parsed value.</typeparam>
27-
/// <param name="result">An <see cref="CommandLine.ParserResult{T}"/> instance.</param>
28-
/// <param name="action">The <see cref="Func{T, Task}"/> to execute.</param>
29-
/// <returns>The same <paramref name="result"/> instance as a <see cref="Task"/> instance.</returns>
30-
public static async Task<ParserResult<T>> WithParsedAsync<T>(this ParserResult<T> result, Func<T, Task> action)
31-
{
32-
if (result is Parsed<T> parsed)
33-
{
34-
await action(parsed.Value);
35-
}
36-
return result;
37-
}
38-
39-
//public static async Task<ParserResult<T>> WithNotParsedAsync<T>(this Task<ParserResult<T>> task, Action<IEnumerable<Error>> action)
40-
//{
41-
// var result = await task;
42-
// if (result is NotParsed<T> notParsed)
43-
// {
44-
// return result.WithNotParsed(action);
45-
// }
46-
// return result;
47-
//}
48-
49-
//public static async Task<ParserResult<T>> WithNotParsedAsync<T>(this ParserResult<T> result, Func<IEnumerable<Error>, Task> errorFunc)
50-
//{
51-
// if (result is NotParsed<T> notParsed)
52-
// {
53-
// await errorFunc(notParsed.Errors);
54-
// }
55-
// return result;
56-
//}
57-
5822
/// <summary>
5923
/// Async version of the WithNotParsed taking a Task as input for dot-appending to the WithParsedAsync extension method.
6024
/// </summary>

source/nanoFirmwareFlasher/FirmwarePackage.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ protected async System.Threading.Tasks.Task<ExitCodes> DownloadAndExtractAsync()
9191

9292
if (response.StatusCode == HttpStatusCode.NotFound)
9393
{
94+
if (Verbosity >= VerbosityLevel.Normal)
95+
{
96+
Console.WriteLine("");
97+
}
98+
9499
// can't find this target
95100
return ExitCodes.E9005;
96101
}

source/nanoFirmwareFlasher/Options.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ public class Options
139139
/// diag[nostic]
140140
/// </summary>
141141
[Option(
142-
'v',
143142
"verbosity",
144143
Required = false,
145144
Default = "n",

source/nanoFirmwareFlasher/Program.cs

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -771,31 +771,38 @@ private static void OutputError(ExitCodes errorCode, bool outputMessage, string
771771
{
772772
if (errorCode != ExitCodes.OK)
773773
{
774-
Console.Write($"Error {errorCode}");
775-
}
776-
777-
if (outputMessage)
778-
{
779-
var exitCodeDisplayName = errorCode.GetAttribute<DisplayAttribute>();
780-
781-
if (!string.IsNullOrEmpty(exitCodeDisplayName.Name))
774+
if (outputMessage)
782775
{
783-
Console.Write($": { exitCodeDisplayName.Name }");
776+
Console.Write($"Error {errorCode}");
777+
}
778+
else
779+
{
780+
Console.Write($"{errorCode}");
784781
}
785782

786-
if (string.IsNullOrEmpty(extraMessage))
783+
if (outputMessage)
787784
{
788-
Console.WriteLine();
785+
var exitCodeDisplayName = errorCode.GetAttribute<DisplayAttribute>();
786+
787+
if (!string.IsNullOrEmpty(exitCodeDisplayName.Name))
788+
{
789+
Console.Write($": { exitCodeDisplayName.Name }");
790+
}
791+
792+
if (string.IsNullOrEmpty(extraMessage))
793+
{
794+
Console.WriteLine();
795+
}
796+
else
797+
{
798+
Console.WriteLine($" ({ extraMessage })");
799+
}
789800
}
790801
else
791802
{
792-
Console.WriteLine($" ({ extraMessage })");
803+
Console.WriteLine("");
793804
}
794805
}
795-
else
796-
{
797-
Console.WriteLine("");
798-
}
799806
}
800807
}
801808
}

source/nanoFirmwareFlasher/nanoFirmwareFlasher.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<PropertyGroup Condition="'$(PackGlobalTool)' == true">
3333
<PackAsTool>true</PackAsTool>
3434
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
35-
<PackageId>nanoFirmwareFlasher</PackageId>
35+
<PackageId>nanoff</PackageId>
3636
<PlatformTarget>x64</PlatformTarget>
3737
</PropertyGroup>
3838

@@ -42,8 +42,8 @@
4242
</PropertyGroup>
4343

4444
<ItemGroup>
45-
<PackageReference Include="CommandLineParser" Version="2.7.82" />
46-
<PackageReference Include="Nerdbank.GitVersioning" Version="3.0.50" PrivateAssets="All" />
45+
<PackageReference Include="CommandLineParser" Version="2.8.0" />
46+
<PackageReference Include="Nerdbank.GitVersioning" Version="3.1.91" PrivateAssets="All" />
4747
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
4848
<PackageReference Include="System.ComponentModel.Annotations" Version="4.7.0" />
4949
<PackageReference Include="System.IO.Ports" Version="4.7.0" />

source/version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
3-
"version": "1.13.0",
3+
"version": "1.14.0",
44
"assemblyVersion": {
55
"precision": "revision"
66
},

0 commit comments

Comments
 (0)