# Copyright (c) 2018 The nanoFramework project contributors
# See LICENSE file in the project root for full license information.

steps:
  - task: CopyFiles@1
    inputs:
      sourceFolder: $(Build.SourcesDirectory)\build
      Contents: |
        *.bin
        *.hex
        *.s19
        *.dfu
      TargetFolder: '$(Build.ArtifactStagingDirectory)\$(BoardName)'
      flattenFolders: true
    condition: and( succeeded(), ne(variables['Build.Reason'], 'PullRequest') )
    displayName: Collecting deployable artifacts

  - task: PublishBuildArtifacts@1
    inputs:
      PathtoPublish: '$(Build.ArtifactStagingDirectory)\$(BoardName)'
      ArtifactName: $(BoardName)
      ArtifactType: Container
    condition: and( succeeded(), ne(variables['Build.Reason'], 'PullRequest') )
    displayName: Publish deployables artifacts

# Copyright (c) 2018 The nanoFramework project contributors
# See LICENSE file in the project root for full license information.

parameters:
  builDirectory: '$(Build.SourcesDirectory)\build'

steps:
  - task: CopyFiles@1
    inputs:
      sourceFolder: ${{ parameters.builDirectory }}
      Contents: |
        *.bin
        *.hex
        *.s19
        *.dfu
      TargetFolder: '$(Build.ArtifactStagingDirectory)\$(BoardName)'
      flattenFolders: true
    condition: and( succeeded(), ne(variables['Build.Reason'], 'PullRequest') )
    displayName: Collecting deployable artifacts

  - task: PublishBuildArtifacts@1
    inputs:
      PathtoPublish: '$(Build.ArtifactStagingDirectory)\$(BoardName)'
      ArtifactName: $(BoardName)
      ArtifactType: Container
    condition: and( succeeded(), ne(variables['Build.Reason'], 'PullRequest') )
    displayName: Publish deployables artifacts

Work Azure Pipeline templates ***NO_CI***
Work Azure Pipeline templates ***NO_CI***

- Add build directory parameter to publish artifacts template

Signed-off-by: José Simões <1616ff7a83d123f98f8f38fa2524eab406644781@eclo.solutions>
