Authorization
Note, a Buildstash app-level API key is required for uploading builds.Request to start
Request to start upload
Use /upload/request endpoint to pass in all key build information, request to begin the upload process, and receive a presigned URL for uploading the build file to.
/upload/request
Upload - Single part
If your primary build file is smaller than 5GB you have the option to upload as a single part.Upload file to presigned URL
Upload the fileIf the upload to S3 was successful, you’ll receive a response like:Note the response may vary slightly depending on your S3 provider, for example AWS S3, Cloudflare R2, etc.
Request
Upload - Multipart
Alternatively, if your primary build file is larger than 5GB, you must upload as multiple parts. Your original upload request will also return a chunked_upload boolean indicating whether multipart upload is advised and available for this build.Request to start upload
Use /upload/request/multipart endpoint to request the presigned URL for each part.
/upload/request/multipart
Upload part
For multipart uploads, once you have the presigned URL for each part, you’ll need to upload that part, store returned ETag, and upload the next part, until all are complete. The provided examples demonstrate a relatively simple approach to this. Note more advanced approaches are possible including parallel uploads for efficiency.If the upload to S3 was successful, you’ll receive a response including the ETag for that part - which is the critical information for verifying the upload later.You’ll want to create an object pairing each part number with the accompanying ETag in order to verify the upload later.
Request
Expansion upload
In addition to your primary build file, you may also optionally upload an expansion file, where this is supported by the target platform on Buildstash. An example of this is uploading an OBB expansion file to accompany a primary APK.Include expansion file details in initial start upload request
When you call /upload/request endpoint in the first step, you’ll include the expansion file details there, and receive the presigned URL to upload to, similarly to with the primary file.
Upload expansion file
Upload your expansion file, using the same logic as with the primary file. Remember to not call /upload/verify until both primary and expansion files are uploaded.
Verify and complete
Verify and complete upload
Once all files are uploaded, use /upload/verify endpoint to inform Buildstash the upload is complete, validate all parts have successfully uploaded, and complete the upload flow. Once you receive a successful response from the endpoint, the build will be available in the Buildstash interface!Note, for some build types where additional server side processing is required (for example iOS and Android builds), the verify endpoint will return the pending_processing boolean as true. In this case there will be a small delay before the build is available for download.
/upload/verify
Best practices
- Retry Logic: Implement retry logic for failed S3 file uploads
- Progress Tracking: Track upload progress for each part of large files
- Parallel Uploads: Upload parts in parallel for better performance
- Cleanup: Handle cleanup on upload failure
Provided integrations
CI Integrations
We provide a number of off-the-shelf integrations for uploading builds to Buildstash via widely used CI platforms - like GitHub Actions and Azure Pipelines.