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 API key with the builds:create scope, 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 custom target
    customTarget: 'Galaxy Store'

    # Optional build associations
    labels: |
      to-review
      signed
    architectures: |
      x64
      x86

    # 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)

    # Optional metadata artifacts (SBOMs, build logs, etc)
    metadataArtifacts: |
      [
        {"path": "$(Build.ArtifactStagingDirectory)/sbom.json", "description": "SBOM"},
        {"path": "$(Build.ArtifactStagingDirectory)/build.log", "description": "Build log"}
      ]

The task automatically captures your Azure Pipelines run name, run ID, and run URL — you do not need to pass these in manually.

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: Test
  timeoutInMinutes: 60 # how long to run the job before automatically cancelling - 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
apiKeyYesAPI key with builds:create scope for this application, should be stored and passed 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 date 2025.01.01
customBuildNumberNoAllows a flexible format custom build number if you have one
labelsNoLabels to attach to the build, one per line (will be created if they do not already exist)
architecturesNoArchitectures this build supports, one per line (must be supported by platform)
customTargetNoCustom target name. Must exactly match a target defined on your application
metadataArtifactsNoMetadata artifacts to attach alongside the build. JSON array of objects with path and optional description. Max 10 files, 5MB each
ciBuildDurationNoCI build duration
vcHostTypeNoVersion control host type (e.g. git)
vcHostNoVersion control host (e.g. github or azure-repos)
vcRepoNameNoRepository name
vcRepoUrlNoRepository URL
vcBranchNoBranch name
vcCommitShaNoCommit SHA
vcCommitUrlNoCommit URL
platformNoPlatform slug — must exactly match a platform attached to your application. See the platforms reference
streamNoStream name — must exactly match a stream on your application
notesNoBuild notes (optional). Max 1,000 characters

Pipeline name, run ID, and run URL are captured automatically from your Azure DevOps environment and sent to Buildstash as CI metadata.

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