Skip to content

Commit

Permalink
Work CI-CD
Browse files Browse the repository at this point in the history
- Temporarily disable publishing nuget helpers from main.
  • Loading branch information
josesimoes committed Nov 30, 2021
1 parent 05941ab commit e11e1f8
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions azure-pipelines-templates/pack-publish-managed-helpers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,35 @@
steps:

# check if managed helper files where changed
- powershell: |
git config --global user.email "[email protected]"
git config --global user.name "nfbot"
# - powershell: |
# git config --global user.email "[email protected]"
# git config --global user.name "nfbot"

$auth = "basic $([System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes(":$(GitHubToken)"))))"
# $auth = "basic $([System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes(":$(GitHubToken)"))))"

$commit = Invoke-RestMethod -Uri "https://api.github.com/repos/nanoframework/nf-interpreter/commits/$(Build.SourceVersion)" -Header @{"Authorization"="$auth"} -ContentType "application/json" -Method GET
Write-host "Files changed:"
$commit.files | % {$_.filename}
# $commit = Invoke-RestMethod -Uri "https://api.github.com/repos/nanoframework/nf-interpreter/commits/$(Build.SourceVersion)" -Header @{"Authorization"="$auth"} -ContentType "application/json" -Method GET
# Write-host "Files changed:"
# $commit.files | % {$_.filename}

if ( $commit.files.filename -like "*$(TargetBoard)/managed_helpers*" )
{
echo "##vso[task.setvariable variable=BUILD_NUGET_PACKAGE]true"
# if ( $commit.files.filename -like "*$(TargetBoard)/managed_helpers*" )
# {
# echo "##vso[task.setvariable variable=BUILD_NUGET_PACKAGE]true"

$counter = $env:HelperPackageVersion
$version = [int]$counter
$packageVersion = "1.0." + $version.ToString()
# $counter = $env:HelperPackageVersion
# $version = [int]$counter
# $packageVersion = "1.0." + $version.ToString()

echo "##vso[task.setvariable variable=PACKAGE_NUGET_VERSION]$packageVersion"
# echo "##vso[task.setvariable variable=PACKAGE_NUGET_VERSION]$packageVersion"

Write-host "Package version is: $packageVersion"
}
else
{
echo "##vso[task.setvariable variable=BUILD_NUGET_PACKAGE]False"
}
# Write-host "Package version is: $packageVersion"
# }
# else
# {
# echo "##vso[task.setvariable variable=BUILD_NUGET_PACKAGE]False"
# }

condition: succeeded()
displayName: Check if managed helpers files were changed
# condition: succeeded()
# displayName: Check if managed helpers files were changed

- template: azure-pipelines-templates/download-logo.yml@templates

Expand Down

0 comments on commit e11e1f8

Please sign in to comment.