Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 22 additions & 16 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ install:
- bundle config --local path vendor/bundle
- gem install bundler --quiet --no-ri --no-rdoc
- gem install github_changelog_generator --quiet --no-ri --no-rdoc
# this needs to be replace with the official version and nuget package as soon as it's released
- dotnet tool install -g --version 4.0.0-pullrequest1422-1625 --add-source https://ci.appveyor.com/nuget/gitversion-8nigugxjftrw GitVersion.CommandLine.DotNetCore.Tool
- dotnet tool install --tool-path . nbgv
- ps: .\install-vsix-appveyor.ps1

before_build:
Expand All @@ -60,25 +59,32 @@ before_build:

nuget restore source\nanoFramework.Networking.Sntp.sln

dotnet-gitversion /l console /output buildserver /updateAssemblyInfo "source\nanoFramework.Networking.Sntp\Properties\AssemblyInfo.cs"
.\nbgv cloud -p "source"

build_script:
- ps: >-

msbuild source\nanoFramework.Networking.Sntp.sln /p:Configuration=Release /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
if ($env:APPVEYOR_REPO_TAG -eq "true")
{
msbuild source\nanoFramework.Networking.Sntp.sln /p:PublicRelease=true /p:Configuration=Release /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
}
else
{
msbuild source\nanoFramework.Networking.Sntp.sln /p:Configuration=Release /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
}

before_deploy:
- ps: >-
.\commit-assemblyinfo-changes.ps1

.\generate-change-log.ps1

Push-AppveyorArtifact $env:APPVEYOR_BUILD_FOLDER\source\Nuget.nanoFramework.Networking.Sntp\bin\Release\nanoFramework.Networking.Sntp.$env:GitVersion_NuGetVersionV2.nupkg
Push-AppveyorArtifact $env:APPVEYOR_BUILD_FOLDER\source\Nuget.nanoFramework.Networking.Sntp\bin\Release\nanoFramework.Networking.Sntp.$env:NBGV_NuGetPackageVersion.nupkg

after_deploy:
# for this environment variable to work here it has to be set in AppVeyor UI
- nuget push source\Nuget.nanoFramework.Networking.Sntp\bin\Release\nanoFramework.Networking.Sntp.%GitVersion_NuGetVersionV2%.nupkg %MyGetToken% -Source https://www.myget.org/F/nanoframework-dev/api/v2/package
- nuget push source\Nuget.nanoFramework.Networking.Sntp.DELIVERABLES\bin\Release\nanoFramework.Networking.Sntp.DELIVERABLES.%GitVersion_NuGetVersionV2%.nupkg %MyGetToken% -Source https://www.myget.org/F/nanoframework-dev/api/v2/package
- nuget push source\Nuget.nanoFramework.Networking.Sntp\bin\Release\nanoFramework.Networking.Sntp.%NBGV_NuGetPackageVersion%.nupkg %MyGetToken% -Source https://www.myget.org/F/nanoframework-dev/api/v2/package
- nuget push source\Nuget.nanoFramework.Networking.Sntp.DELIVERABLES\bin\Release\nanoFramework.Networking.Sntp.DELIVERABLES.%NBGV_NuGetPackageVersion%.nupkg %MyGetToken% -Source https://www.myget.org/F/nanoframework-dev/api/v2/package

# requires APPVEYOR_DISCORD_WEBHOOK_URL enviroment variable set with Discord webhook URL
on_failure:
Expand Down Expand Up @@ -108,9 +114,9 @@ for:
on:
appveyor_repo_tag: true
- provider: GitHub
tag: v$(GitVersion_NuGetVersionV2)
release: nanoFramework.Networking.Sntp Library v$(GitVersion_NuGetVersionV2)
description: 'Check the [changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/blob/master/CHANGELOG.md)\n\n## Install from NuGet\n\nThe following NuGet packages are available for download from this release\n\n:package: [.NET](https://www.nuget.org/packages/nanoFramework.Networking.Sntp/$(GitVersion_NuGetVersionV2)) v$(GitVersion_NuGetVersionV2)'
tag: v$(NBGV_NuGetPackageVersion)
release: nanoFramework.Networking.Sntp Library v$(NBGV_NuGetPackageVersion)
description: 'Check the [changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/blob/master/CHANGELOG.md)\n\n## Install from NuGet\n\nThe following NuGet packages are available for download from this release\n\n:package: [.NET](https://www.nuget.org/packages/nanoFramework.Networking.Sntp/$(NBGV_NuGetPackageVersion)) v$(NBGV_NuGetPackageVersion)'
auth_token:
secure: DNixoFFE+pGlwyhj7McfZoln42vOmj0iY1iNV9zXEr3y0NpXlOIgL8k5ehzlFM1S
artifact:
Expand All @@ -126,9 +132,9 @@ for:

deploy:
- provider: GitHub
tag: v$(GitVersion_NuGetVersionV2)
release: nanoFramework.Networking.Sntp Library v$(GitVersion_NuGetVersionV2)
description: 'Check the [changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/blob/$(appveyor_repo_branch)/CHANGELOG.md)\n\n## Install from nanoFramework MyGet development feed\n\nThe following NuGet packages are available for download from this release\n\npackage: [.NET](https://www.myget.org/feed/nanoframework-dev/package/nuget/nanoFramework.Networking.Sntp/$(GitVersion_NuGetVersionV2)) v$(GitVersion_NuGetVersionV2)'
tag: v$(NBGV_NuGetPackageVersion)
release: nanoFramework.Networking.Sntp Library v$(NBGV_NuGetPackageVersion)
description: 'Check the [changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/blob/$(appveyor_repo_branch)/CHANGELOG.md)\n\n## Install from nanoFramework MyGet development feed\n\nThe following NuGet packages are available for download from this release\n\npackage: [.NET](https://www.myget.org/feed/nanoframework-dev/package/nuget/nanoFramework.Networking.Sntp/$(NBGV_NuGetPackageVersion)) v$(NBGV_NuGetPackageVersion)'
auth_token:
secure: DNixoFFE+pGlwyhj7McfZoln42vOmj0iY1iNV9zXEr3y0NpXlOIgL8k5ehzlFM1S
artifact:
Expand All @@ -150,9 +156,9 @@ for:
on:
appveyor_repo_tag: true
- provider: GitHub
tag: v$(GitVersion_NuGetVersionV2)
release: nanoFramework.Networking.Sntp Library v$(GitVersion_NuGetVersionV2)
description: 'Check the [changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/blob/$(appveyor_repo_branch)/CHANGELOG.md)\n\n## Install from NuGet\n\nThe following NuGet packages are available for download from this release\n\n:package: [.NET](https://www.nuget.org/packages/nanoFramework.Networking.Sntp/$(GitVersion_NuGetVersionV2)) v$(GitVersion_NuGetVersionV2)'
tag: v$(NBGV_NuGetPackageVersion)
release: nanoFramework.Networking.Sntp Library v$(NBGV_NuGetPackageVersion)
description: 'Check the [changelog](https://github.com/nanoframework/lib-nanoFramework.Networking.Sntp/blob/$(appveyor_repo_branch)/CHANGELOG.md)\n\n## Install from NuGet\n\nThe following NuGet packages are available for download from this release\n\n:package: [.NET](https://www.nuget.org/packages/nanoFramework.Networking.Sntp/$(NBGV_NuGetPackageVersion)) v$(NBGV_NuGetPackageVersion)'
auth_token:
secure: DNixoFFE+pGlwyhj7McfZoln42vOmj0iY1iNV9zXEr3y0NpXlOIgL8k5ehzlFM1S
artifact:
Expand Down
60 changes: 41 additions & 19 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# .NET Desktop
# Build and run tests for .NET Desktop or Windows classic desktop solutions.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net
trigger:
branches:
include: ["master", "*"]
paths:
exclude: ["doc", "*.md", ".appveyor.yml"]

pr:
branches:
include: [ "*" ]

pool:
vmImage: 'VS2017-Win2016'
Expand All @@ -20,24 +25,28 @@ steps:
feedsToUse: config
nugetConfigPath: source/NuGet.config

# Download file
# - task: DownloadFile@1
# inputs:
# FileUrl: 'https://marketplace.visualstudio.com/_apis/public/gallery/publishers/vs-publisher-1470366/vsextensions/nanoFrameworkVS2017Extension/0/vspackage'
- task: DotNetCoreCLI@2
inputs:
command: custom
custom: tool
arguments: install --tool-path . nbgv
displayName: Install NBGV tool

# # install nanoFramework VS extension
# - task: PowerShell@2
# inputs:
# targetType: 'inline'
# script: 'Install-Module VSSetup -Scope CurrentUser -AcceptLicense -Force'
# errorActionPreference: 'stop'
- script: nbgv cloud -p "source"
displayName: Set build number
condition: ne(variables['system.pullrequest.isfork'], true)

# install nanoFramework VS extension
- task: PowerShell@2
inputs:
filePath: 'install-nf-vs-extension.ps1'
errorActionPreference: 'stop'

# # Batch Script
# - task: BatchScript@1
# inputs:
# filename: '$(INSTALLER_PATH)'

# # Run a command line script using cmd.exe on Windows and bash on macOS and Linux.
# - task: CmdLine@2
# inputs:
Expand All @@ -51,17 +60,30 @@ steps:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'

- task: VSTest@2
# we don't have tests (yet)
# - task: VSTest@2
# inputs:
# platform: '$(buildPlatform)'
# configuration: '$(buildConfiguration)'

- task: CopyFiles@1
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
sourceFolder: $(System.DefaultWorkingDirectory)
Contents: |
**source\Nuget.*\*.nupkg
TargetFolder: $(Build.ArtifactStagingDirectory)/deployables
flattenFolders: true
displayName: Collecting deployable artifacts

- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/deployables
ArtifactName: deployables
ArtifactType: Container
displayName: Publish deployables artifacts

- task: NuGetCommand@2
inputs:
command: push
nuGetFeedType: external
publishFeedCredentials: 'MyGet'
versioningScheme: byEnvVar
versionEnvVar: Version
22 changes: 3 additions & 19 deletions commit-assemblyinfo-changes.ps1
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
# Copyright (c) 2018 The nanoFramework project contributors
# See LICENSE file in the project root for full license information.

# skip updating assembly info changes if build is a pull-request or not a tag (can't commit when repo is in a tag)
if ($env:appveyor_pull_request_number -or $env:APPVEYOR_REPO_TAG -eq "true")
{
'Skip committing assembly info changes...' | Write-Host -ForegroundColor White
}
else
{
# updated assembly info files
git add "source\nanoFramework.Networking.Sntp\Properties\AssemblyInfo.cs"
git commit -m "Update assembly info file for v$env:GitVersion_NuGetVersionV2" -m"[version update]"
git push origin --porcelain -q > $null

'Updated assembly info...' | Write-Host -ForegroundColor White -NoNewline
'OK' | Write-Host -ForegroundColor Green
}

# update assembly info in nf-interpreter if this is tag
if ($env:APPVEYOR_REPO_TAG -eq "true")
{
Expand All @@ -27,13 +11,13 @@ if ($env:APPVEYOR_REPO_TAG -eq "true")
cd nf-interpreter > $null

# new branch name
$newBranch = "$env:APPVEYOR_REPO_BRANCH-nfbot/update-version/nanoFramework.Networking.Sntp/$env:GitVersion_NuGetVersionV2"
$newBranch = "$env:APPVEYOR_REPO_BRANCH-nfbot/update-version/nanoFramework.Networking.Sntp/$env:NBGV_NuGetPackageVersion"

# create branch to perform updates
git checkout -b "$newBranch" develop -q

# replace version in assembly declaration
$newVersion = $env:GitVersion_AssemblySemFileVer -replace "\." , ", "
$newVersion = $env:NBGV_GitBuildVersion -replace "\." , ", "
$newVersion = "{ $newVersion }"

$versionRegex = "\{\s*\d+\,\s*\d+\,\s*\d+\,\s*\d+\s*}"
Expand All @@ -56,7 +40,7 @@ if ($env:APPVEYOR_REPO_TAG -eq "true")
}
else
{
$commitMessage = "Update nanoFramework.Networking.Sntp version to $env:GitVersion_NuGetVersionV2"
$commitMessage = "Update nanoFramework.Networking.Sntp version to $env:NBGV_NuGetPackageVersion"

# commit changes
git add -A 2>&1
Expand Down
4 changes: 2 additions & 2 deletions generate-change-log.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ else
if ($env:APPVEYOR_REPO_BRANCH -eq "master" -or $env:APPVEYOR_REPO_BRANCH -match "^release*")
{
# generate change log including future version
bundle exec github_changelog_generator --token $env:GitHubToken --future-release "v$env:GitVersion_MajorMinorPatch"
bundle exec github_changelog_generator --token $env:GitHubToken --future-release "v$env:NBGV_GitVersion_MajorMinorPatch"
}
else
{
Expand All @@ -25,7 +25,7 @@ else

# updated changelog and the updated assembly info files
git add CHANGELOG.md
git commit -m "Update CHANGELOG for v$env:GitVersion_NuGetVersionV2"
git commit -m "Update CHANGELOG for v$env:NBGV_NuGetPackageVersion"
# need to wrap the git command bellow so it doesn't throw an error because of redirecting the output to stderr
git push origin --porcelain | Write-Host
}
36 changes: 16 additions & 20 deletions install-nf-vs-extension.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@
# | Select-VSSetupInstance `
# | Select-Object -ExpandProperty InstallationPath

# # extension path
# $vsixPath = Join-Path $env:Agent_TempDirectory "nanoFramework.Tools.VS2017.Extension.vsix"
# extension path
$vsixPath = Join-Path $env:Agent_TempDirectory "nanoFramework.Tools.VS2017.Extension.vsix"
# installer path
$INSTALLER_PATH = Join-Path $env:Agent_TempDirectory "install-vsix.cmd"
Write-Host ("##vso[task.setvariable variable=INSTALLER_PATH;]$INSTALLER_PATH")

# "Downloading extension from marketplace..." | Write-Host -ForegroundColor White

Expand All @@ -40,33 +43,23 @@ $FilePath = "${env:Temp}\$Name"

Invoke-WebRequest -Uri $Url -OutFile $FilePath

$ArgumentList = ('/quiet', $FilePath)
# $ArgumentList = ('/quiet /a', $FilePath)

# install on normal process
Write-Host "Starting Install $Name..."
$process = Start-Process -FilePath 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VSIXInstaller.exe' -ArgumentList $ArgumentList -Wait -PassThru -NoNewWindow
$exitCode = $process.ExitCode

if ($exitCode -eq 0 -or $exitCode -eq 3010)
{
Write-Host -Object 'Installation successful'
return $exitCode
}
else
{
Write-Host -Object "Non zero exit code returned by the installation process : $exitCode."
return $exitCode
}

# install on process with timeout
Start-Process -FilePath 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VSIXInstaller.exe' -ArgumentList " /skuName:Enterprise /skuVersion:15.0 /quiet /a $FilePath" -Wait -PassThru

# # install on process with timeout
# Write-Host "Starting Install $Name..."

# $proc = Start-Process -FilePath 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VSIXInstaller.exe' -ArgumentList $ArgumentList -Wait -PassThru
# $proc = Start-Process -FilePath 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VSIXInstaller.exe' -ArgumentList "/q /a $FilePath" -Wait -PassThru

# # keep track of timeout event
# $timeouted = $null # reset any previously set timeout

# # wait up to 4 minutes (4 * 60 = 240 seconds) for normal termination
# $proc | Wait-Process -Timeout 240 -ErrorAction SilentlyContinue -ErrorVariable timeouted
# Wait-Process -Name "VSIXInstaller" -Timeout 240 -ErrorAction SilentlyContinue -ErrorVariable $timeouted
# # $proc | Wait-Process -Timeout 240 -ErrorAction SilentlyContinue -ErrorVariable timeouted

# if ($timeouted)
# {
Expand All @@ -85,6 +78,9 @@ else
# ("`"$vsInstallPath\Common7\IDE\VSIXInstaller.exe`" /q $vsixPath" | Out-File $installScript -Encoding ASCII)

# # "`"$vsInstallPath\Common7\IDE\VSIXInstaller.exe`" /q /a $vsixPath" | out-file ".\install-vsix.cmd" -Encoding ASCII
# "`"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VSIXInstaller.exe`" /skuName:Enterprise /skuVersion:15.0 /q /a `"$vsixPath`"" | out-file $INSTALLER_PATH -Encoding ASCII
"`"$vsInstallPath\Common7\IDE\VSIXInstaller.exe`" /skuName:Enterprise /skuVersion:15.0 /q `"$vsixPath`"" | out-file $INSTALLER_PATH -Encoding ASCII

# Start-Process -FilePath "$vsInstallPath\Common7\IDE\VSIXInstaller.exe" -ArgumentList "/q $extension" -Wait -PassThru

# 'Installing nanoFramework VS extension ...' | Write-Host -ForegroundColor White -NoNewline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup>
<GitVersion_NuGetVersionV2 Condition=" '$(GitVersion_NuGetVersionV2)' == '' ">1.0.0-preview001</GitVersion_NuGetVersionV2>
<NBGV_NuGetPackageVersion Condition=" '$(NBGV_NuGetPackageVersion)' == '' ">1.0.0-preview001</NBGV_NuGetPackageVersion>
</PropertyGroup>
<ItemGroup>
<Folder Include="content\" />
Expand Down Expand Up @@ -50,7 +50,7 @@
<Import Project="$(NuProjPath)\NuProj.props" Condition="Exists('$(NuProjPath)\NuProj.props')" />
<PropertyGroup Label="Configuration">
<Id>nanoFramework.Networking.Sntp.DELIVERABLES</Id>
<Version>$(GitVersion_NuGetVersionV2)</Version>
<Version>$(NBGV_NuGetPackageVersion)</Version>
<Title>nanoFramework.Networking.Sntp.DELIVERABLES</Title>
<Authors>nanoFramework project contributors</Authors>
<Owners>nanoFramework project contributors</Owners>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup>
<GitVersion_NuGetVersionV2 Condition=" '$(GitVersion_NuGetVersionV2)' == '' ">1.0.0-preview001</GitVersion_NuGetVersionV2>
<NBGV_NuGetPackageVersion Condition=" '$(NBGV_NuGetPackageVersion)' == '' ">1.0.0-preview001</NBGV_NuGetPackageVersion>
</PropertyGroup>
<ItemGroup>
<Content Include="..\nanoFramework.Networking.Sntp\bin\$(Configuration)\nanoFramework.Networking.Sntp.dll">
Expand Down Expand Up @@ -47,7 +47,7 @@
<Import Project="$(NuProjPath)\NuProj.props" Condition="Exists('$(NuProjPath)\NuProj.props')" />
<PropertyGroup Label="Configuration">
<Id>nanoFramework.Networking.Sntp</Id>
<Version>$(GitVersion_NuGetVersionV2)</Version>
<Version>$(NBGV_NuGetPackageVersion)</Version>
<Title>nanoFramework.Networking.Sntp</Title>
<Authors>nanoFramework project contributors</Authors>
<Owners>nanoFramework project contributors</Owners>
Expand Down
15 changes: 0 additions & 15 deletions source/nanoFramework.Networking.Sntp/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
Expand All @@ -14,17 +13,3 @@
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.1.0")]
[assembly: AssemblyVersion("1.0.1.0")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: AssemblyInformationalVersion("1.0.1-preview016")]
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@
<HintPath>..\packages\nanoFramework.CoreLibrary.1.0.5-preview024\lib\mscorlib.dll</HintPath>
<Private>True</Private>
<SpecificVersion>True</SpecificVersion>
</Reference>
</Reference>
</ItemGroup>
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets')" />
<Import Project="..\packages\Nerdbank.GitVersioning.2.2.13\build\Nerdbank.GitVersioning.targets" />
<ProjectExtensions>
<ProjectCapabilities>
<ProjectConfigurationsDeclaredAsItems />
Expand Down
1 change: 1 addition & 0 deletions source/nanoFramework.Networking.Sntp/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="nanoFramework.CoreLibrary" version="1.0.5-preview024" targetFramework="netnanoframework10" />
<package id="Nerdbank.GitVersioning" version="2.2.13" developmentDependency="true" />
<package id="NuProj" version="0.20.4-beta" developmentDependency="true" />
<package id="NuProj.Common" version="0.20.4-beta" developmentDependency="true" />
</packages>
Loading