I have an Azure DevOps pipeline that builds an Android bundle. After the task that builds my app, there are two tasks as below. Log of the first one shows that $(Build.BinariesDirectory)
folder contains MyApp.aab
and MyApp-Signed.aab
. But the second task doesn't find anything and copies 0 files.
Any ideas why it is happening? I've tried everything including hard-coding /Users/runner/work/1/b/MyApp-Signed.aab
which is the actual path from log of previous tasks.
- task: Bash@3
inputs:
targetType: 'inline'
script: 'ls'
workingDirectory: '$(Build.BinariesDirectory)'
- task: CopyFiles@2
inputs:
Contents: '$(Build.BinariesDirectory)/*.aab'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
OverWrite: true
flattenFolders: true
I have an Azure DevOps pipeline that builds an Android bundle. After the task that builds my app, there are two tasks as below. Log of the first one shows that $(Build.BinariesDirectory)
folder contains MyApp.aab
and MyApp-Signed.aab
. But the second task doesn't find anything and copies 0 files.
Any ideas why it is happening? I've tried everything including hard-coding /Users/runner/work/1/b/MyApp-Signed.aab
which is the actual path from log of previous tasks.
- task: Bash@3
inputs:
targetType: 'inline'
script: 'ls'
workingDirectory: '$(Build.BinariesDirectory)'
- task: CopyFiles@2
inputs:
Contents: '$(Build.BinariesDirectory)/*.aab'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
OverWrite: true
flattenFolders: true
Share
Improve this question
asked Nov 17, 2024 at 6:02
Delphi.BoyDelphi.Boy
1,2264 gold badges20 silver badges41 bronze badges
1 Answer
Reset to default 0I found the solution. The missing piece was SourceFolder
. By default it is set to $(Build.SourcesDirectory)
so it couldn't find the .aab
files. The working version is:
- task: CopyFiles@2
inputs:
Contents: '*.aab'
SourceFolder: '$(Build.BinariesDirectory)'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
OverWrite: true
flattenFolders: true