I was working with Azure DevOps, creating a pipeline for a dotnet application that requires Libman—a library that I’m not used to working with, so I had a few issues trying to install it and using the restore command; after searching in Google for a couple of hours and using the ‘trial/error’ method, I finally found a way to make it work.
The first step is to install the LibMan CLI globally
- task: DotNetCoreCLI@2
displayName: 'Libman install'
inputs:
command: custom
custom: tool
arguments: 'install -g Microsoft.Web.LibraryManager.Cli'
With LibMan CLI installed, you use a simple script line to perform the libman restore, but in my case, I needed to specify the working directory since it was located in a subdirectory.
- task: CmdLine@2
displayName: 'LibMan Restore'
inputs:
script: 'libman restore'
workingDirectory: 'src/your-folder-where-libman.json-is-located'
You should find the references below to get more details about it.
That’s it. Happy build!
REFERENCES:
https://learn.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml