CI/CD

Azure DevOps Pipelines

Uploading build artifacts from your Azure DevOps pipeline

Create API token

To upload builds using this CI integration you'll need to create an application specific API token, via the standard steps.

Install Buildstash extension to your organization

Find Buildstash extension in marketplace

Go to the Buildstash extension in the Visual Studio Marketplace for Azure Pipelines.

Buildstash extension in marketplace

Select "Get it free" to install.

Install on your organization

Select the organization you'd like to install the extension on from the dropdown.

Install

Alternatively, if you're using Azure DevOps Server, select "Download".

Extension will be installed

Extension successfully installed

Once the extension is installed you'll be able to proceed to using it in your pipelines.

Add action to your pipeline

Add BuildstashUpload task to your .yml

You can copy and paste the provided code into your pipeline yaml script. Set your file paths, platform, stream, and version fields as applicable. See further down for a full list of inputs with descriptions.

- task: BuildstashUpload@1
    displayName: Upload to Buildstash
    inputs:
      apiKey: $(BUILDSTASH_API_KEY)
      structure: 'file'
      primaryFilePath: 'example.exe'
      versionComponent1Major: '1'
      versionComponent2Minor: '0'
      versionComponent3Patch: '1'
      versionComponentExtra: 'beta'
      versionComponentMeta: '2024.12.02'
      customBuildNumber: '12345'
      platform: 'windows'
      stream: 'default'

      # Optional CI info
      ciBuildDuration: '15m30s'

      # Optional VC info
      vcHostType: 'git'
      vcHost: 'github'
      vcRepoName: $(Build.Repository.Name)
      vcRepoUrl: $(Build.Repository.Uri)
      vcBranch: $(Build.SourceBranchName)
      vcCommitSha: $(Build.SourceVersion)
      vcCommitUrl: $(Build.Repository.Uri)/commit/$(Build.SourceVersion)
Add API key as a secret variable

When editing your Pipeline, go to "Variables" and add a new variable.

Add variable

To match the sample code above, call the API key BUILDSTASH_API_KEY, paste in your previously generated key, and ensure you select "Keep this value secret".

Note, the API key is application-specific, i.e. matched to one application in Buildstash. So you'll want to generate a unique API key for each pipeline and application.

Tweak timeout value if needed

By default Azure DevOps will timeout jobs after 60 minutes.

This is probably fine, but if you are uploading a particularly massive build, or have a slow connection, you may wish to tweak this.

This is done on the job as below:

jobs:- job: TesttimeoutInMinutes: 60 # how long to run the job before automatically cancelling in minutes - increase if needed for large uploads

Refer to Azure docs for more detail.

Use outputs if needed

Once the build is successfully uploaded, some useful information is provided by the task as outputs. For example, the URL to download the build directly. See below for a full list of outputs.

Run pipeline, and start seeing builds in Buildstash!

Success

Successful Pipeline runs will now be sending your builds into Buildstash, giving you seamless management, organization, and distribution of your builds.

Inputs

A breakdown of all required and optional inputs for the Buildstash upload task.

Input NameRequired?Description
apiKeyYesApplication specific API Key, should be stored and pass in as a secret
structureYesStructure type. Either file (for single file build) or file+expansion (for a primary build file with a single expansion file, i.e. apk + obb)
primaryFilePathYesPath to the primary file to upload
expansionFilePathNoPath to an expansion file to be paired with primary (optional)
versionComponent1MajorYesMajor version component
versionComponent2MinorYesMinor version component
versionComponent3PatchYesPatch version component
versionComponentExtraNoExtra version component (optional). Pre-release label like 'beta' or 'alpha'
versionComponentMetaNoMeta version component (optional). Can be used to add additional metadata to your version, such as data 2025.01.01)
customBuildNumberNoAllows a flexible format custom build number if you have one. (Optional)
labelsNoArray of labels to attach to build (will be created if they do not already exist)
architecturesNoArray of architectures this build supports (must be supported by platform)
ciBuildDurationNoCI build duration
vcHostTypeNoVersion control host type
vcHostNoVersion control host
vcRepoNameNoRepository name
vcRepoUrlNoRepository URL
vcBranchNoBranch name
vcCommitShaNoCommit SHA
vcCommitUrlNoCommit URL
platformYesPlatform slug (see list here for reference)
streamYesStream - the exact name of the stream on your app this build will be sent to
notesNoBuild notes (optional)

Outputs

A breakdown of outputs the task provides.

Output NameDescription
buildIdBuildstash ID associated with the newly created build
pendingProcessingWhether the build is pending additional processing on server (typically iOS or Android builds)
buildInfoUrlURL to view the build information on Buildstash
downloadUrlURL to download the build on Buildstash (requires authentication in workspace and permission to access build)

Buildstash on Azure DevOps Marketplace