Skip to content

Commit

Permalink
Work CI-CD
Browse files Browse the repository at this point in the history
- Tidy up azure pipeline yaml.
- Replace wildcard with solution name.
- Add readme to nuspec.
- Fix package owners in nuspec.
- Fix log URL and typos in readme.
- Update test framework ref and sub-module @ 9c1674d.
- Update nbgv.
  • Loading branch information
josesimoes committed Nov 20, 2021
1 parent f439af1 commit 97db183
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 26 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=nanoframework_lib-CoreLibrary&metric=alert_status)](https://sonarcloud.io/dashboard?id=nanoframework_lib-CoreLibrary) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=nanoframework_lib-CoreLibrary&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=nanoframework_lib-CoreLibrary) [![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) [![NuGet](https://img.shields.io/nuget/dt/nanoFramework.CoreLibrary.svg?label=NuGet&style=flat&logo=nuget)](https://www.nuget.org/packages/nanoFramework.CoreLibrary/) [![#yourfirstpr](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](https://github.com/nanoframework/Home/blob/main/CONTRIBUTING.md)
[![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/main/resources/logo/nanoFramework-repo-logo.png)
![nanoFramework logo](https://raw.githubusercontent.com/nanoframework/Home/main/resources/logo/nanoFramework-repo-logo.png)

-----

# Welcome to the **nanoFramework** Base Class Library repository!
# Welcome to the .NET **nanoFramework** Base Class Library repository

## Build status

Expand All @@ -26,7 +26,7 @@ nanoFramework has a dedicated [Unit Test framework](https://github.com/nanoframe

CoreLibrary has specific needs that differ from what you'll find in the documentation:

- You need to have the nanoFramework.TestFramework as a nuget package as it will bring the nanoCLR Win32 emulator
- You need to have the nanoFramework.TestFramework as a NuGet package as it will bring the nanoCLR Win32 emulator
- You need to remove the reference to mscorlib, nanoFramework.TestFramework and nanoFramework.UnitTestLauncher
- Use project reference instead for all those 3 elements

Expand All @@ -51,7 +51,7 @@ vstest.console.exe .\Tests\NFUnitTestBitConverter\bin\Release\NFUnitTest.dll /S

*Notes*:

- You have to build the TestAdapter from the source in this case. You can use the path to the nuget as well, this will have the same effect.
- You have to build the TestAdapter from the source in this case. You can use the path to the NuGet as well, this will have the same effect.
- you have full diagnostic enabled in this case.

## Feedback and documentation
Expand All @@ -70,7 +70,7 @@ The **nanoFramework** Class Libraries are licensed under the [MIT license](LICEN

## Code of Conduct

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community.
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behaviour in our community.
For more information see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).

### .NET Foundation
Expand Down
6 changes: 3 additions & 3 deletions Tests/NFUnitTest_DummyAdapter/NFUnitTest_DummyAdapter.nfproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@
<Private>True</Private>
<SpecificVersion>True</SpecificVersion>
</Reference>
<Reference Include="nanoFramework.TestFramework, Version=1.0.132.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
<HintPath>..\..\packages\nanoFramework.TestFramework.1.0.132\lib\nanoFramework.TestFramework.dll</HintPath>
<Reference Include="nanoFramework.TestFramework, Version=1.0.157.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
<HintPath>..\..\packages\nanoFramework.TestFramework.1.0.157\lib\nanoFramework.TestFramework.dll</HintPath>
<Private>True</Private>
<SpecificVersion>True</SpecificVersion>
</Reference>
<Reference Include="nanoFramework.UnitTestLauncher, Version=0.0.0.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
<HintPath>..\..\packages\nanoFramework.TestFramework.1.0.132\lib\nanoFramework.UnitTestLauncher.exe</HintPath>
<HintPath>..\..\packages\nanoFramework.TestFramework.1.0.157\lib\nanoFramework.UnitTestLauncher.exe</HintPath>
<Private>True</Private>
<SpecificVersion>True</SpecificVersion>
</Reference>
Expand Down
2 changes: 1 addition & 1 deletion Tests/NFUnitTest_DummyAdapter/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="nanoFramework.CoreLibrary" version="1.10.5-preview.10" targetFramework="netnanoframework10" />
<package id="nanoFramework.TestFramework" version="1.0.132" targetFramework="netnanoframework10" developmentDependency="true" />
<package id="nanoFramework.TestFramework" version="1.0.157" targetFramework="netnanoframework10" developmentDependency="true" />
</packages>
58 changes: 50 additions & 8 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ trigger:
branches:
include: [main, develop, "release-*" ]
paths:
exclude: [README.md, LICENSE.md, NuGet.Config, .github_changelog_generator, .gitignore]
exclude: [README.md, LICENSE.md, CHANGELOG.md, CODE_OF_CONDUCT.md, NuGet.Config, .github_changelog_generator, .gitignore]
tags:
include: ["v*"]

# PR always trigger build
pr:
autoCancel: true

# add nf-tools repo to resources (for Azure Pipelines templates)
resources:
Expand All @@ -26,7 +28,7 @@ jobs:

variables:
DOTNET_NOLOGO: true
solution: '**/*.sln'
solution: 'nanoFramework.CoreLibrary.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
nugetPackageName: 'nanoFramework.CoreLibrary'
Expand Down Expand Up @@ -76,7 +78,12 @@ jobs:

# need to push the other package to NuGet because the template above can only push one package (happens on all builds except PRs)
- task: NuGetCommand@2
condition: and( succeeded(), eq(variables['System.PullRequest.PullRequestId'], ''), eq( variables['StartReleaseCandidate'], false ) )
condition: >-
and(
succeeded(),
eq(variables['System.PullRequest.PullRequestId'], ''),
eq(variables['StartReleaseCandidate'], false)
)
displayName: Push "NoReflection" variant NuGet package to Azure Artifacts
inputs:
command: push
Expand All @@ -88,7 +95,12 @@ jobs:
continueOnError: true

- task: NuGetCommand@2
condition: and( succeeded(), eq(variables['System.PullRequest.PullRequestId'], ''), eq( variables['StartReleaseCandidate'], false ) )
condition: >-
and(
succeeded(),
eq(variables['System.PullRequest.PullRequestId'], ''),
eq(variables['StartReleaseCandidate'], false)
)
displayName: Push "NoReflection" variant NuGet package to Azure Artifacts
inputs:
command: push
Expand All @@ -101,7 +113,13 @@ jobs:

# create or update GitHub release
- task: GithubRelease@1
condition: and( succeeded(), eq(variables['System.PullRequest.PullRequestId'], ''), not( startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ), ne( variables['StartReleaseCandidate'], true ) )
condition: >-
and(
succeeded(),
eq(variables['System.PullRequest.PullRequestId'], ''),
not(startsWith(variables['Build.SourceBranch'], 'refs/tags/v')),
ne(variables['StartReleaseCandidate'], true)
)
displayName: Create/Update GitHub PREVIEW release
inputs:
gitHubConnection: 'github.com_nano-$(System.TeamProject)'
Expand All @@ -117,7 +135,13 @@ jobs:

# create or update GitHub release ON tags from release or master branches
- task: GithubRelease@1
condition: and( succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'), not(contains(variables['Build.SourceBranch'], 'preview') ), ne( variables['StartReleaseCandidate'], true ) )
condition: >-
and(
succeeded(),
startsWith(variables['Build.SourceBranch'], 'refs/tags/v'),
not(contains(variables['Build.SourceBranch'], 'preview')),
ne(variables['StartReleaseCandidate'], true)
)
displayName: Create/Update GitHub stable release
inputs:
gitHubConnection: 'github.com_nano-$(System.TeamProject)'
Expand All @@ -133,7 +157,20 @@ jobs:

##############################
- job: Update_Dependents
condition: or( and( succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v'), eq(variables['StartReleaseCandidate'], 'false') ), and( succeeded(), contains(variables['getCommitMessage.COMMIT_MESSAGE'], '***UPDATE_DEPENDENTS***'), eq(variables['StartReleaseCandidate'], 'false') ), eq(variables['UPDATE_DEPENDENTS'], 'true') )
condition: >-
or(
and(
succeeded(),
startsWith(variables['Build.SourceBranch'], 'refs/tags/v'),
eq(variables['StartReleaseCandidate'], 'false')
),
and(
succeeded(),
contains(variables['getCommitMessage.COMMIT_MESSAGE'], '***UPDATE_DEPENDENTS***'),
eq(variables['StartReleaseCandidate'], 'false')
),
eq(variables['UPDATE_DEPENDENTS'], 'true')
)
dependsOn:
- Build_mscorlib
Expand Down Expand Up @@ -190,7 +227,12 @@ jobs:
dependsOn:
- Build_mscorlib
- Update_Dependents
condition: or( failed('Build_mscorlib'), failed('Build_mscorlib_no_reflection'), failed('Update_Dependents'))
condition: >-
or(
failed('Build_mscorlib'),
failed('Build_mscorlib_no_reflection'),
failed('Update_Dependents')
)
pool:
vmImage: 'windows-2019'
Expand Down
4 changes: 3 additions & 1 deletion nanoFramework.CoreLibrary.NoReflection.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
<version>$version$</version>
<title>nanoFramework.CoreLibrary.NoReflection</title>
<authors>nanoFramework project contributors</authors>
<owners>nanoFramework project contributors,dotnetfoundation</owners>
<owners>nanoFramework,dotnetfoundation</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<license type="file">LICENSE.md</license>
<releaseNotes></releaseNotes>
<readme>docs\README.md</readme>
<developmentDependency>false</developmentDependency>
<projectUrl>https://github.com/nanoframework/CoreLibrary</projectUrl>
<icon>images\nf-logo.png</icon>
Expand All @@ -25,6 +26,7 @@
<file src="nanoFramework.CoreLibrary.NoReflection\bin\Release\mscorlib.xml" target="lib\mscorlib.xml" />

<file src="assets\readme.txt" target="" />
<file src="README.md" target="docs\" />
<file src="assets\nf-logo.png" target="images" />
<file src="LICENSE.md" target="" />
</files>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,11 +406,11 @@
<ProjectConfigurationsDeclaredAsItems />
</ProjectCapabilities>
</ProjectExtensions>
<Import Project="..\packages\Nerdbank.GitVersioning.3.4.205\build\Nerdbank.GitVersioning.targets" Condition="Exists('..\packages\Nerdbank.GitVersioning.3.4.205\build\Nerdbank.GitVersioning.targets')" />
<Import Project="..\packages\Nerdbank.GitVersioning.3.4.244\build\Nerdbank.GitVersioning.targets" Condition="Exists('..\packages\Nerdbank.GitVersioning.3.4.244\build\Nerdbank.GitVersioning.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105.The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Nerdbank.GitVersioning.3.4.205\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Nerdbank.GitVersioning.3.4.205\build\Nerdbank.GitVersioning.targets'))" />
<Error Condition="!Exists('..\packages\Nerdbank.GitVersioning.3.4.244\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Nerdbank.GitVersioning.3.4.244\build\Nerdbank.GitVersioning.targets'))" />
</Target>
</Project>
2 changes: 1 addition & 1 deletion nanoFramework.CoreLibrary.NoReflection/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
<package id="Microsoft.Build.Tasks.Git" version="1.0.0" targetFramework="netnanoframework10" developmentDependency="true" />
<package id="Microsoft.SourceLink.Common" version="1.0.0" targetFramework="netnanoframework10" developmentDependency="true" />
<package id="Microsoft.SourceLink.GitHub" version="1.0.0" targetFramework="netnanoframework10" developmentDependency="true" />
<package id="Nerdbank.GitVersioning" version="3.4.205" developmentDependency="true" targetFramework="netnanoframework10" />
<package id="Nerdbank.GitVersioning" version="3.4.244" developmentDependency="true" targetFramework="netnanoframework10" />
</packages>
4 changes: 3 additions & 1 deletion nanoFramework.CoreLibrary.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
<version>$version$</version>
<title>nanoFramework.CoreLibrary</title>
<authors>nanoFramework project contributors</authors>
<owners>nanoFramework project contributors,dotnetfoundation</owners>
<owners>nanoFramework,dotnetfoundation</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<license type="file">LICENSE.md</license>
<releaseNotes></releaseNotes>
<readme>docs\README.md</readme>
<developmentDependency>false</developmentDependency>
<projectUrl>https://github.com/nanoframework/CoreLibrary</projectUrl>
<icon>images\nf-logo.png</icon>
Expand All @@ -25,6 +26,7 @@
<file src="nanoFramework.CoreLibrary\bin\Release\mscorlib.xml" target="lib\mscorlib.xml" />

<file src="assets\readme.txt" target="" />
<file src="README.md" target="docs\" />
<file src="assets\nf-logo.png" target="images" />
<file src="LICENSE.md" target="" />
</files>
Expand Down
4 changes: 2 additions & 2 deletions nanoFramework.CoreLibrary/CoreLibrary.nfproj
Original file line number Diff line number Diff line change
Expand Up @@ -398,11 +398,11 @@
<ProjectConfigurationsDeclaredAsItems />
</ProjectCapabilities>
</ProjectExtensions>
<Import Project="..\packages\Nerdbank.GitVersioning.3.4.205\build\Nerdbank.GitVersioning.targets" Condition="Exists('..\packages\Nerdbank.GitVersioning.3.4.205\build\Nerdbank.GitVersioning.targets')" />
<Import Project="..\packages\Nerdbank.GitVersioning.3.4.244\build\Nerdbank.GitVersioning.targets" Condition="Exists('..\packages\Nerdbank.GitVersioning.3.4.244\build\Nerdbank.GitVersioning.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105.The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Nerdbank.GitVersioning.3.4.205\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Nerdbank.GitVersioning.3.4.205\build\Nerdbank.GitVersioning.targets'))" />
<Error Condition="!Exists('..\packages\Nerdbank.GitVersioning.3.4.244\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Nerdbank.GitVersioning.3.4.244\build\Nerdbank.GitVersioning.targets'))" />
</Target>
</Project>
2 changes: 1 addition & 1 deletion nanoFramework.CoreLibrary/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
<package id="Microsoft.Build.Tasks.Git" version="1.0.0" targetFramework="netnanoframework10" developmentDependency="true" />
<package id="Microsoft.SourceLink.Common" version="1.0.0" targetFramework="netnanoframework10" developmentDependency="true" />
<package id="Microsoft.SourceLink.GitHub" version="1.0.0" targetFramework="netnanoframework10" developmentDependency="true" />
<package id="Nerdbank.GitVersioning" version="3.4.205" developmentDependency="true" targetFramework="netnanoframework10" />
<package id="Nerdbank.GitVersioning" version="3.4.244" developmentDependency="true" targetFramework="netnanoframework10" />
</packages>

0 comments on commit 97db183

Please sign in to comment.