This guide covers uploading via single or multipart upload flows. Multipart is required for build files above 5GB, and optional for files smaller than this.
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.
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.
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.
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.
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.