diff --git a/azure-pipelines.yml b/azure-pipelines.yml index b0861e63..8b712480 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -217,6 +217,11 @@ jobs: - task: Cache@2 displayName: Cache NuGet packages + condition: >- + and( + succeeded(), + eq(variables['UPDATE_DEPENDENTS'], 'false') + ) inputs: key: 'nuget | "$(Agent.OS)" | **/packages.lock.json, !bin/**' restoreKeys: | @@ -344,7 +349,11 @@ jobs: Find-ReplaceInFile -filePath $fileToReplace -sourceString $sourceString -targetString $instrumentKey displayName: Replace intrument key - condition: succeeded() + condition: >- + and( + succeeded(), + eq(variables['UPDATE_DEPENDENTS'], 'false') + ) - task: CopyFiles@1 condition: >- @@ -415,7 +424,7 @@ jobs: eq(variables['System.PullRequest.PullRequestId'], ''), eq(variables['UPDATE_DEPENDENTS'], 'false') ) - displayName: Push nanoff NuGet package to NuGet + displayName: Push nanoff dotnet tool to NuGet continueOnError: true inputs: command: push @@ -433,7 +442,7 @@ jobs: eq(variables['System.PullRequest.PullRequestId'], ''), eq(variables['UPDATE_DEPENDENTS'], 'false') ) - displayName: Push library NuGet package to NuGet + displayName: Push NuGet package with library to NuGet continueOnError: true inputs: command: push @@ -462,6 +471,7 @@ jobs: action: create isDraft: false addChangeLog: true + changeLogType: issueBased changeLogLabels: | [ { "label" : "Type: bug", "displayName" : "Bugs fixed", "state" : "closed" }, @@ -475,6 +485,7 @@ jobs: - task: PowerShell@2 condition: >- or( + eq(variables['System.PullRequest.PullRequestId'], ''), eq(variables['UPDATE_DEPENDENTS'], 'true'), eq(variables['run_update_dependents'], 'true') ) diff --git a/azure-pipelines/update-dependents.ps1 b/azure-pipelines/update-dependents.ps1 index 399824d8..399db064 100644 --- a/azure-pipelines/update-dependents.ps1 +++ b/azure-pipelines/update-dependents.ps1 @@ -2,7 +2,7 @@ # compute authorization header in format "AUTHORIZATION: basic 'encoded token'" # 'encoded token' is the Base64 of the string "nfbot:personal-token" -$auth = "basic $([System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("nfbot:$env:GH_TOKEN"))))" +$auth = "basic $([System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("nfbot:$env:GH_TOKEN")))" # init/reset these $commitMessage = "" @@ -55,21 +55,21 @@ $commitMessage += "`n[version update]`n`n" # better add this warning line $commitMessage += "### :warning: This is an automated update. Merge only after all tests pass. :warning:`n" -Write-Debug "Git branch" - -# create branch to perform updates -git branch $newBranchName - -Write-Debug "Checkout branch" - -# checkout branch -git checkout $newBranchName - # check if anything was changed $repoStatus = "$(git status --short --porcelain)" if ($repoStatus -ne "") { + Write-Debug "Git branch" + + # create branch to perform updates + git branch $newBranchName + + Write-Debug "Checkout branch" + + # checkout branch + git checkout $newBranchName + Write-Debug "Add changes" # commit changes @@ -114,5 +114,5 @@ if ($repoStatus -ne "") } else { - Write-Host "Nothing udpate at nanoFramework.Tools.FirmwareFlasher." + Write-Host "Nothing udpate at $repoName." }