diff --git a/README.md b/README.md index 574fd19b..035c6ce1 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,8 @@ This repo contains: | Component | Build Status | NuGet Package (.NET) | NuGet Package (.UWP) | |:-|---|---|---| -| Debugger Library | [![Build status](https://ci.appveyor.com/api/projects/status/ut8h2hjxe1fvusnj/branch/develop?svg=true)](https://ci.appveyor.com/project/nfbot/nf-debugger/branch/develop) | [![NuGet](https://img.shields.io/nuget/vpre/nanoFramework.Tools.Debugger.Net.svg)](https://www.nuget.org/packages/nanoFramework.Tools.Debugger.Net/) | | [![NuGet](https://img.shields.io/nuget/vpre/nanoFramework.Tools.Debugger.UWP.svg)](https://www.nuget.org/packages/nanoFramework.Tools.Debugger.UWP/) | -| Debugger Library (preview) | [![Build status](https://ci.appveyor.com/api/projects/status/ut8h2hjxe1fvusnj/branch/develop?svg=true)](https://ci.appveyor.com/project/nfbot/nf-debugger/branch/develop) | [![MyGet Pre Release](https://img.shields.io/myget/nanoframework-dev/vpre/nanoFramework.Tools.Debugger.Net.svg)](https://www.myget.org/feed/nanoframework-dev/package/nuget/nanoFramework.Tools.Debugger.Net) | [![MyGet Pre Release](https://img.shields.io/myget/nanoframework-dev/vpre/nanoFramework.Tools.Debugger.UWP.svg)](https://www.myget.org/feed/nanoframework-dev/package/nuget/nanoFramework.Tools.Debugger.UWP) | +| Debugger Library | [![Build status](https://ci.appveyor.com/api/projects/status/ut8h2hjxe1fvusnj/branch/master?svg=true)](https://ci.appveyor.com/project/nfbot/nf-debugger/branch/master) | [![NuGet](https://img.shields.io/nuget/vpre/nanoFramework.Tools.Debugger.Net.svg)](https://www.nuget.org/packages/nanoFramework.Tools.Debugger.Net/) | | [![NuGet](https://img.shields.io/nuget/vpre/nanoFramework.Tools.Debugger.UWP.svg)](https://www.nuget.org/packages/nanoFramework.Tools.Debugger.UWP/) | +| Debugger Library (preview) | [![Build Status](https://dev.azure.com/nanoframework/debugger/_apis/build/status/nanoframework.nf-debugger)](https://dev.azure.com/nanoframework/debugger/_build/latest?definitionId=33) | [![MyGet Pre Release](https://img.shields.io/myget/nanoframework-dev/vpre/nanoFramework.Tools.Debugger.Net.svg)](https://www.myget.org/feed/nanoframework-dev/package/nuget/nanoFramework.Tools.Debugger.Net) | [![MyGet Pre Release](https://img.shields.io/myget/nanoframework-dev/vpre/nanoFramework.Tools.Debugger.UWP.svg)](https://www.myget.org/feed/nanoframework-dev/package/nuget/nanoFramework.Tools.Debugger.UWP) | ## Feedback and documentation diff --git a/appveyor-discord.ps1 b/appveyor-discord.ps1 deleted file mode 100644 index a1ce8b91..00000000 --- a/appveyor-discord.ps1 +++ /dev/null @@ -1,82 +0,0 @@ -# Copyright (c) 2017 The nanoFramework project contributors -# Portions Copyright (c) Sankarsan Kampa (a.k.a. k3rn31p4nic). All rights reserved. -# See LICENSE file in the project root for full license information. - -$STATUS=$args[0] -$WEBHOOK_URL=$args[1] - -Write-Output "[Webhook]: Sending webhook to Discord..." - -Switch ($STATUS) { - "success" { - $EMBED_COLOR=3066993 - $STATUS_MESSAGE="Passed" - Break - } - "failure" { - $EMBED_COLOR=15158332 - $STATUS_MESSAGE="Failed" - Break - } - default { - Write-Output "Default!" - Break - } -} - -if (!$env:APPVEYOR_REPO_COMMIT) { - $env:APPVEYOR_REPO_COMMIT="$(git log -1 --pretty="%H")" -} - -$AUTHOR_NAME="$(git log -1 "$env:APPVEYOR_REPO_COMMIT" --pretty="%aN")" -$COMMITTER_NAME="$(git log -1 "$env:APPVEYOR_REPO_COMMIT" --pretty="%cN")" -$COMMIT_SUBJECT="$(git log -1 "$env:APPVEYOR_REPO_COMMIT" --pretty="%s")" -$COMMIT_MESSAGE="$(git log -1 "$env:APPVEYOR_REPO_COMMIT" --pretty="%b")" - -if ($AUTHOR_NAME -eq $COMMITTER_NAME) { - $CREDITS = "$AUTHOR_NAME authored & committed" -} -else { - $CREDITS = "$AUTHOR_NAME authored & $COMMITTER_NAME committed" -} - -if ($env:APPVEYOR_PULL_REQUEST_NUMBER) { - $URL="https://github.com/$env:APPVEYOR_REPO_NAME/pull/$env:APPVEYOR_PULL_REQUEST_NUMBER" -} -else { - $URL="" -} - -$BUILD_VERSION = [uri]::EscapeDataString($env:APPVEYOR_BUILD_VERSION) - -$WEBHOOK_DATA="{ - ""embeds"": [ { - ""color"": $EMBED_COLOR, - ""author"": { - ""name"": ""Job #$env:APPVEYOR_JOB_NUMBER (Build #$env:APPVEYOR_BUILD_NUMBER) $STATUS_MESSAGE - $env:APPVEYOR_REPO_NAME"", - ""url"": ""https://ci.appveyor.com/project/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/build/$BUILD_VERSION"", - ""icon_url"": ""$AVATAR"" - }, - ""title"": ""$COMMIT_SUBJECT"", - ""url"": ""$URL"", - ""description"": ""$COMMIT_MESSAGE $CREDITS"", - ""fields"": [ - { - ""name"": ""Commit"", - ""value"": ""[``$($env:APPVEYOR_REPO_COMMIT.substring(0, 7))``](https://github.com/$env:APPVEYOR_REPO_NAME/commit/$env:APPVEYOR_REPO_COMMIT)"", - ""inline"": true - }, - { - ""name"": ""Branch/Tag"", - ""value"": ""[``$env:APPVEYOR_REPO_BRANCH``](https://github.com/$env:APPVEYOR_REPO_NAME/tree/$env:APPVEYOR_REPO_BRANCH)"", - ""inline"": true - } - ] - } ], - ""content"" : """", - ""file"": """" -}" - -Invoke-RestMethod -Uri $WEBHOOK_URL -Method POST -UserAgent AppVeyor-Webhook -ContentType 'application/json' -Body $WEBHOOK_DATA - -Write-Output "[Webhook]: Successfully sent the webhook." diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index e6a9118b..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,170 +0,0 @@ -# configuration for all branches - -image: Visual Studio 2017 - -skip_tags: false - -skip_branch_with_pr: true - -test: off - -pull_requests: - do_not_increment_build_number: true - -# Skipping commits affecting specific files -skip_commits: - files: - - '**\AssemblyInfo.*' - - '**/*.md' - - 'LICENSE' - - dir/* - - '.gitignore' - - 'azure-pipelines.yml' - -build: - verbosity: minimal - -environment: - APPVEYOR_SAVE_CACHE_ON_ERROR: true - matrix: - - RUBY_VERSION: 24 - GitHubUserName: - secure: 7OBtVAMTodMWK20wg6pGnQ== - GitHubUserEmail: - secure: /NpmL1KqwHyHFnF0GlUovA586wDIt8Hg/Q8Dro6kUpk= - GitHubToken: - secure: i/2hGsqVMwzdM5yIS4rxOIeG3ftx7su7klWYN80s/fHvgk7A5H2fF3oUTNLcyTbw - GitRestAuth: - secure: E3bCMe4LtDdAhHSYRcLp0N6DixJe1m8TNxhYeJW/GnqM3WXdRqsgkHSbwootPjJQtOQJrps4twmzTVzofLSVgPgbzU8PxU0AkJV7zwkyVOE= - -init: -- git config --global core.autocrlf true -- git config --global credential.helper store -- ps: Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:GitHubToken):x-oauth-basic@github.com`n" -- git config --global user.email "%GitHubUserEmail%" -- git config --global user.name "%GitHubUserName%" -- ps: "$headers = if($env:APPVEYOR_PULL_REQUEST_NUMBER){\n @{\n \"Authorization\" = \"Basic $env:GitRestAuth\"\n \"Content-type\" = \"application/json\"\n}\n\n$pr = Invoke-RestMethod -Uri \"https://api.github.com/repos/$env:APPVEYOR_REPO_NAME/pulls/$env:APPVEYOR_PULL_REQUEST_NUMBER\" -Headers $headers -Method GET\n\nif($pr.user.login -eq \"nfbot\" -and $pr.body -match \"*[version update]*\")\n{\n # commit was from nfbot AND it's taged as a [version update]\n # OK to skip AppVeyor build \n \"Version update only. Skipping build.\" | Write-Host -BackgroundColor White -ForegroundColor Blue\n Exit-AppveyorBuild\n} }\n" -- ps: "if($env:APPVEYOR_PULL_REQUEST_NUMBER -eq \"\")\n{\n \n if($env:APPVEYOR_REPO_COMMIT_AUTHOR -eq \"nfbot\" -and $env:APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED -like \"*[version update]*\")\n {\n # commit was from nfbot AND it's taged as a [version update]\n # OK to skip AppVeyor build \n \"Version update only. Skipping build.\" | Write-Host -BackgroundColor White -ForegroundColor Blue\n Exit-AppveyorBuild\n }\n}" - -install: -- set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH% -- bundle config --local path vendor/bundle -- gem install bundler --quiet --no-ri --no-rdoc -- gem install github_changelog_generator --quiet --no-ri --no-rdoc -- dotnet tool install --tool-path . nbgv - -before_build: -- ps: >- - - nuget restore source\nanoFramework.Tools.Debugger.sln - - .\nbgv cloud -p source -a -c - -build_script: -- ps: >- - - msbuild source\nanoFramework.Tools.Debugger.sln /p:PublicRelease=true /p:Configuration=Release /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" - - msbuild /t:pack source\nanoFramework.Tools.DebugLibrary.Net\nanoFramework.Tools.DebugLibrary.Net.csproj /p:PublicRelease=true /p:Configuration=Release /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" - - msbuild /t:pack source\nanoFramework.Tools.DebugLibrary.UWP\nanoFramework.Tools.DebugLibrary.UWP.csproj /p:PublicRelease=true /p:Configuration=Release /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" - -before_deploy: - - ps: >- - .\nbgv cloud --version=$env:NBGV_SemVer1 - - $env:MyNuGetVersion = $env:NBGV_NuGetPackageVersion -replace "\-g$env:NBGV_GitCommitIdShort", " " - - .\generate-change-log.ps1 - - Push-AppveyorArtifact $env:APPVEYOR_BUILD_FOLDER\source\nanoFramework.Tools.DebugLibrary.Net\bin\Release\nanoFramework.Tools.Debugger.Net.$env:NBGV_NuGetPackageVersion.nupkg - - Push-AppveyorArtifact $env:APPVEYOR_BUILD_FOLDER\source\nanoFramework.Tools.DebugLibrary.UWP\bin\Release\nanoFramework.Tools.Debugger.UWP.$env:NBGV_NuGetPackageVersion.nupkg - -after_deploy: -# for this environment variable to work here it has to be set in AppVeyor UI -- nuget push source\nanoFramework.Tools.DebugLibrary.Net\bin\Release\nanoFramework.Tools.Debugger.Net.%NBGV_NuGetPackageVersion%.nupkg %MyGetToken% -Source https://www.myget.org/F/nanoframework-dev/api/v2/package -- nuget push source\nanoFramework.Tools.DebugLibrary.UWP\bin\Release\nanoFramework.Tools.Debugger.UWP.%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: - - ps: | - - & $env:APPVEYOR_BUILD_FOLDER\appveyor-discord.ps1 failure $env:APPVEYOR_DISCORD_WEBHOOK_URL - -cache: - - source\packages -> **source\packages.config - -################################################ -# override configuration for specific branches -for: - -- - branches: - only: - - master - - /v\d.*/ - - deploy: - - provider: NuGet - api_key: $(NuGetToken) - skip_symbols: true - on: - appveyor_repo_tag: true - - provider: GitHub - tag: v$(NBGV_NuGetPackageVersion) - release: nanoFramework Debugger Library v$(NBGV_Version) - description: 'Check the [changelog](https://github.com/nanoframework/nf-debugger/blob/master/CHANGELOG.md)\n\n## Install from NuGet\n\nThe following NuGet packages are available for download from this release\n\n[.NET](https://www.nuget.org/packages/nanoFramework.Tools.Debugger.Net/$(NBGV_NuGetPackageVersion)) v$(NBGV_NuGetPackageVersion)\n\n:package: [UWP](https://www.nuget.org/packages/nanoFramework.Tools.Debugger.UWP/$(NBGV_NuGetPackageVersion)) v$(NBGV_NuGetPackageVersion)' - auth_token: - secure: DNixoFFE+pGlwyhj7McfZoln42vOmj0iY1iNV9zXEr3y0NpXlOIgL8k5ehzlFM1S - artifact: - draft: true - prerelease: true - force_update: true - on: - appveyor_repo_tag: false - -- - branches: - only: - - /dev(elop)?$/ - - skip_branch_with_pr: true - - deploy: - - provider: GitHub - tag: v$(NBGV_NuGetPackageVersion) - release: nanoFramework Debugger Library v$(NBGV_Version) - description: 'Check the [changelog](https://github.com/nanoframework/nf-debugger/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\n:package: [.NET](https://www.myget.org/feed/nanoframework-dev/package/nuget/nf-debugger/nanoFramework.Tools.Debugger.UWP/$(NBGV_NuGetPackageVersion)) v$(NBGV_NuGetPackageVersion)\n\n:package: [UWP](https://www.myget.org/feed/nanoframework-dev/package/nuget/nanoFramework.Tools.Debugger.UWP/$(NBGV_NuGetPackageVersion)) v$(NBGV_NuGetPackageVersion)' - auth_token: - secure: DNixoFFE+pGlwyhj7McfZoln42vOmj0iY1iNV9zXEr3y0NpXlOIgL8k5ehzlFM1S - artifact: - draft: true - prerelease: true - force_update: true - on: - appveyor_repo_tag: false - -- - branches: - only: - - /release.*/ - - deploy: - - provider: NuGet - api_key: $(NuGetToken) - skip_symbols: true - on: - appveyor_repo_tag: true - - provider: GitHub - tag: v$(NBGV_NuGetPackageVersion) - release: nanoFramework Debugger Library v$(NBGV_Version) - description: 'Check the [changelog](https://github.com/nanoframework/nf-debugger/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[.NET](https://www.nuget.org/packages/nanoFramework.Tools.Debugger.Net/$(NBGV_NuGetPackageVersion)) v$(NBGV_NuGetPackageVersion)\n\n:package: [UWP](https://www.nuget.org/packages/nanoFramework.Tools.Debugger.UWP/$(NBGV_NuGetPackageVersion)) v$(NBGV_NuGetPackageVersion)' - auth_token: - secure: DNixoFFE+pGlwyhj7McfZoln42vOmj0iY1iNV9zXEr3y0NpXlOIgL8k5ehzlFM1S - artifact: - draft: true - prerelease: true - force_update: true - on: - appveyor_repo_tag: false diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000..8c2021b7 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,230 @@ +trigger: + branches: + include: + - master + - develop + - release/* + - refs/tags/* + paths: + exclude: + - /*.md + - .gitignore + - appveyor.yml + # waiting for feature to become available + # tags: + # include: + # - v/* + +pr: + branches: + include: + - master + - develop + - release/* + autoCancel: true + +# add nf-tools repo to resources (for Azure Pipelines templates) +resources: + repositories: + - repository: templates + type: github + name: nanoframework/nf-tools + endpoint: nanoframework + +pool: + vmImage: 'VS2017-Win2016' + +variables: + solution: '**/source/*.sln' + buildPlatform: 'Any CPU' + buildConfiguration: 'Release' + +steps: + +# need this here in order to persist GitHub credentials +- checkout: self + persistCredentials: true + +- script: | + git config --global user.email 'nfbot' + git config --global user.name 'nanoframework@outlook.com' + displayName: Setup git identity + +- task: NuGetToolInstaller@0 + +- task: NuGetCommand@2 + inputs: + restoreSolution: '$(solution)' + displayName: NuGet restore + +- task: VSBuild@1 + inputs: + solution: '$(solution)' + platform: '$(buildPlatform)' + msbuildArgs: '/p:PublicRelease=true' + configuration: '$(buildConfiguration)' + +- task: MSBuild@1 + inputs: + solution: '**\nanoFramework.Tools.DebugLibrary.Net.csproj' + configuration: '$(buildConfiguration)' + msbuildArguments: '/t:pack /p:PublicRelease=true' + condition: succeeded() + displayName: Pack .NET NuGet package + +- task: MSBuild@1 + inputs: + solution: '**\nanoFramework.Tools.DebugLibrary.UWP.csproj' + configuration: '$(buildConfiguration)' + msbuildArguments: '/t:pack /p:PublicRelease=true' + condition: succeeded() + displayName: Pack UWP NuGet package + +# we don't have tests (yet) +# - task: VSTest@2 +# inputs: +# platform: '$(buildPlatform)' +# configuration: '$(buildConfiguration)' + +- task: PowerShell@2 + inputs: + targetType: 'inline' + script: | + $MyNuGetVersion = $env:NBGV_NuGetPackageVersion -replace "\-g$env:NBGV_GitCommitIdShort", "" + + # replace preview with alpha if this is a PR build + if($env:Build_Reason -eq 'PullRequest') + { + $MyNuGetVersion = $MyNuGetVersion -replace "preview", "alpha" + } + + Write-Host "NuGet build number is $MyNuGetVersion" + + Write-Host "$("##vso[task.setvariable variable=MY_NUGET_VERSION]")$MyNuGetVersion" + condition: succeeded() + displayName: Get NuGet build number + + +- task: UseRubyVersion@0 + inputs: + versionSpec: '>= 2.4' + addToPath: true + condition: and( succeeded(), not( startsWith(variables['Build.SourceBranch'], 'refs/pull') ) ) + displayName: Setup Ruby + +# generate change log +- powershell: | + gem install github_changelog_generator --quiet --no-ri --no-rdoc + # need to call it passing both cache options with full path otherwise it won't work + github_changelog_generator --token $(GitHubToken) --cache-log $env:AGENT_TEMPDIRECTORY\github-changelog-logger.log --cache-file $env:AGENT_TEMPDIRECTORY\github-changelog-http-cache + condition: and( succeeded(), not( startsWith(variables['Build.SourceBranch'], 'refs/pull') ), not( startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ), or( eq(variables['Build.SourceBranchName'], 'master'), contains(variables['Build.SourceBranchName'], 'release') ) ) + displayName: Generate change log + +# generate change log including future version +- powershell: | + gem install github_changelog_generator --quiet --no-ri --no-rdoc + # need to call it passing both cache options with full path otherwise it won't work + github_changelog_generator --token $(GitHubToken) --cache-log $env:AGENT_TEMPDIRECTORY\github-changelog-logger.log --cache-file $env:AGENT_TEMPDIRECTORY\github-changelog-http-cache --future-release v$env:MY_NUGET_VERSION + condition: and( succeeded(), not( startsWith(variables['Build.SourceBranch'], 'refs/pull') ), not( startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ), not( or( eq(variables['Build.SourceBranchName'], 'master'), contains(variables['Build.SourceBranchName'], 'release') ) ) ) + displayName: Generate change log + +# copy change log to artifacts directory +- task: CopyFiles@2 + inputs: + SourceFolder: '$(System.DefaultWorkingDirectory)' + Contents: 'CHANGELOG.md' + TargetFolder: '$(Build.ArtifactStagingDirectory)' + condition: and( succeeded(), not( startsWith(variables['Build.SourceBranch'], 'refs/pull') ), not( startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ) ) + displayName: Copy Changelog + +# push new changelog to GitHub repo +- script: | + git add CHANGELOG.md + git commit -m "Update CHANGELOG for v$(NBGV_Version)" -m"***NO_CI***" + git push origin "HEAD:$(Build.SourceBranchName)" --porcelain + workingDirectory: $(System.DefaultWorkingDirectory) + condition: and( succeeded(), not( startsWith(variables['Build.SourceBranch'], 'refs/pull') ), not( startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ) ) + displayName: Push changelog to GitHub + +# update could build number (only possible if this is not a PR from a fork) +- task: PowerShell@2 + inputs: + targetType: 'inline' + script: Write-Host "$("##vso[build.updatebuildnumber]")$env:MY_NUGET_VERSION" + condition: and( succeeded(), ne(variables['system.pullrequest.isfork'], true) ) + displayName: Update cloud build number + +- task: CopyFiles@1 + inputs: + sourceFolder: $(Build.SourcesDirectory) + Contents: | + **\$(nugetPackageName)*.nupkg + TargetFolder: '$(Build.ArtifactStagingDirectory)' + flattenFolders: true + condition: succeeded() + displayName: Collecting deployable artifacts + +# publish artifacts (only possible if this is not a PR originated on a fork) +- task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)' + ArtifactName: deployables + ArtifactType: Container + condition: and( succeeded(), ne(variables['system.pullrequest.isfork'], true) ) + displayName: Publish deployables artifacts + +# push NuGet packages to MyGet feed (always happens except on PR builds) +- task: NuGetCommand@2 + inputs: + command: push + nuGetFeedType: external + packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg' + publishFeedCredentials: 'MyGet' + condition: succeeded() + displayName: Push NuGet packages to MyGet + +# create or update GitHub release +- task: GitHubReleasePublish@1 + inputs: + githubEndpoint: 'nanoframework' + githubOwner: 'nanoframework' + githubRepositoryName: $(repoName) + githubTag: v$(MY_NUGET_VERSION) + githubReleaseTitle: 'nanoFramework Debugger Library v$(MY_NUGET_VERSION)' + githubReleaseNotes: 'Check the [changelog]($(Build.Repository.Uri)/blob/$(Build.SourceBranchName)/CHANGELOG.md).

Install from nanoFramework MyGet development feed


The following NuGet packages are available for download from this release:
:package: [.NET](https://www.nuget.org/packages/$(nugetPackageName)/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION)
:package: [UWP](https://www.myget.org/feed/nanoframework-dev/package/nuget/nanoFramework.Tools.Debugger.UWP/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION)' + githubTargetCommitsh: $(Build.SourceVersion) + githubReleaseDraft: true + githubReleasePrerelease: true + githubReuseDraftOnly: true + githubReuseRelease: true + githubEditRelease: 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: + githubEndpoint: 'nanoframework' + githubOwner: 'nanoframework' + githubRepositoryName: $(repoName) + githubTag: v$(MY_NUGET_VERSION) + githubReleaseTitle: 'nanoFramework Debugger Library v$(MY_NUGET_VERSION)' + githubReleaseNotes: 'Check the [changelog]($(Build.Repository.Uri)/blob/$(Build.SourceBranchName)/CHANGELOG.md).

Install from NuGet


The following NuGet packages are available for download from this release:
:package: [.NET](https://www.nuget.org/packages/nanoFramework.Tools.Debugger.Net/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION) v$(MY_NUGET_VERSION)
:package: [UWP](https://www.nuget.org/packages/nanoFramework.Tools.Debugger.UWP/$(MY_NUGET_VERSION)) v$(MY_NUGET_VERSION)' + githubTargetCommitsh: $(Build.SourceVersion) + githubReleaseDraft: false + githubReleasePrerelease: false + githubReuseDraftOnly: false + githubReuseRelease: true + githubEditRelease: true + githubReleaseAsset: '$(Build.ArtifactStagingDirectory)/*.nupkg' + condition: and( succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/v') ) + displayName: Create/Update GitHub release + +# step from template @ nf-tools repo +# report error +- template: azure-pipelines-templates/discord-webhook-task.yml@templates + parameters: + status: 'failure' + webhookUrl: '$(DiscordWebhook)' + message: '' diff --git a/generate-change-log.ps1 b/generate-change-log.ps1 deleted file mode 100644 index 7385c270..00000000 --- a/generate-change-log.ps1 +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (c) 2018 The nanoFramework project contributors -# See LICENSE file in the project root for full license information. - -# skip generating the change log when 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 change log processing...' | Write-Host -ForegroundColor White -} -else -{ - # need this to keep ruby happy - md c:\tmp > $null - - 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:NBGV_Version" - } - else - { - # generate change log - # version includes commits - bundle exec github_changelog_generator --token $env:GitHubToken - } - - # updated changelog, if there are any differences - $logDif = git diff CHANGELOG.md - - if($logDif -ne $null) - { - git add CHANGELOG.md - git commit -m "Update CHANGELOG for v$env:MyNuGetVersion" - # need to wrap the git command bellow so it doesn't throw an error because of redirecting the output to stderr - git push origin "HEAD:$env:APPVEYOR_REPO_BRANCH" --porcelain | Write-Host - } -} diff --git a/source/version.json b/source/version.json index f01af0d2..3e8c1466 100644 --- a/source/version.json +++ b/source/version.json @@ -15,13 +15,6 @@ ], "cloudBuild": { "setVersionVariables": true, - "setAllVariables": true, - "buildNumber": { - "enabled": true, - "includeCommitId": { - "when": "nonPublicReleaseOnly", - "where": "buildMetadata" - } - } + "setAllVariables": true } } \ No newline at end of file