Skip to content

Commit

Permalink
Merge branch 'main' into test-pipeline-build
Browse files Browse the repository at this point in the history
  • Loading branch information
networkfusion authored Jun 14, 2024
2 parents 8d5bf3a + 32d976d commit be53542
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 15 deletions.
17 changes: 14 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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: >-
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -462,6 +471,7 @@ jobs:
action: create
isDraft: false
addChangeLog: true
changeLogType: issueBased
changeLogLabels: |
[
{ "label" : "Type: bug", "displayName" : "Bugs fixed", "state" : "closed" },
Expand All @@ -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')
)
Expand Down
24 changes: 12 additions & 12 deletions azure-pipelines/update-dependents.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -114,5 +114,5 @@ if ($repoStatus -ne "")
}
else
{
Write-Host "Nothing udpate at nanoFramework.Tools.FirmwareFlasher."
Write-Host "Nothing udpate at $repoName."
}

0 comments on commit be53542

Please sign in to comment.