Forum Discussion
How should I publish my distributable release files in a release pipeline?
Hello community, I have been looking up quite some time on the subject of pipelines, but strangely, I cannot get to find an answer for this very simple scenario I have.
Thing is, the releases to our software need to be published as a easily downloadable and versioned file/s or installer. Why? Because due to the nature of the bussiness, target environments do not have internet connection, so we need to offer manually downloadable distributable files/installer to manually install them.
I have tried different things but these don't seem to work for me:
- Publish as a "Pipeline Artifact": This option doesn't work in classic Release Pipelines (it throws an error "Cannot upload to a pipeline artifact from release environment.").
- Publish as a "Build artifact": If I do it in a build pipeline, it will defeat the purpose of separation between "build" and "release" pipelines. Even if I did it anyway, it will be published as a "build" artifact, which will be very hard to reach in the Azure Devops web app: Pipelines>(Pipeline name)>(browse run name)>Artifacts>Artifact name, which also gets deleted like 30 days after.
- Publish with "Universal Publish": This option seems to be very apt, since releases are added into the Azure Artifacts feed with a corresponding version number in a very "official" manner (i yet have to see how to assign this version number dynamically from build stage). But the problem is that apparently it's not possible to download universal packages from Azures Web App UI for https://developercommunity.visualstudio.com/t/download-universal-package-trough-api/495533. Instead, I have to use Azure CLI. But i need to be able for me or any team member to download this artifact easily and without installing additional software or technical knowledge.
Am I missing something here?
Some considerations: we only have an Azure Devops plan, no other Azure services (storage, etc).
1 Reply
May consider below as workaround:
1. Upload to Release Pipeline Logs
You can zip your distributable files and use a logging command to attach them to the release logs:echo "##vso[task.uploadfile]$(System.DefaultWorkingDirectory)\yourfile.zip"
• This makes the file downloadable directly from the release pipeline UI.
• It’s not elegant, but it’s accessible and doesn’t require extra tools.
2. Use Azure DevOps Extension
Try the extension “Publish and Download Artifacts from Release Pipelines”:
• It allows uploading files from release pipelines and downloading them from the UI.
• You can find it in the Azure DevOps Marketplace.
3. Push to Git Repo
If your repo permits it, you can push release files into a dedicated folder in your Git repo:
• Use a script in the release pipeline to commit and push the files.
• This gives you versioning and easy access via the repo browser.
4. Use REST API to Generate Download Links
If you go with build artifacts, you can retain builds and generate direct download links using the Azure DevOps REST API:https://dev.azure.com/{organization}/{project}/_apis/build/builds/{buildId}/artifacts?artifactName={artifactName}&api-version=7.2-preview.5&$format=zip
• This requires some scripting but avoids CLI tools for the end user.