Search code examples
azure-devopsazure-pipelinesazure-artifacts

Compile and reuse exe in Azure pipelines


In Azure DevOps, can I build a solution using the Visual studio Build task, publish the .exe file to the artifacts (or somewhere else, repo?) and then utilize that .exe file in another pipeline? If so, to where and how should I publish it and then how do I reference it? thanks


Solution

  • D.J. recommended possible solution, though I am using different approach with Universal Packages:

    1. Once the binary is produced, the pipeline publishes it as Universal Package to Artifact Feet https://learn.microsoft.com/en-us/azure/devops/pipelines/artifacts/universal-packages?view=azure-devops&tabs=yaml#publish-a-universal-package
    2. Any other pipeline in project or organization can reference the Artifact Feed and utilize the binary as part of the job https://learn.microsoft.com/en-us/azure/devops/pipelines/artifacts/universal-packages?view=azure-devops&tabs=yaml#download-a-universal-package

    This solution requires more effort, since you have to create the Artifact Feed, but it is possible to use the published artifacts across projects within the organization. This is ideal when project produces libraries for integration. Other projects can reference the feed and use up-to-date libraries as part of their build.

    Artifact feeds support Semantic Versioning. You can find more about Artifact Feeds in Azure DevOps here https://learn.microsoft.com/en-us/azure/devops/artifacts/concepts/feeds?view=azure-devops

    It only depends on what are your specific requirements.