I want to automate my Android build process so that the APK generated during the pipeline is uploaded directly to the Bitbucket Downloads section. The APK file is in a folder that is included in gitignore since it is created during the build.
Is there a clean and reliable way to make Bitbucket Pipelines generate the APK and push it to Downloads automatically after each build or on specific branches like main or release?
Any step by step guidance or example configuration would be very helpful.
You can make Bitbucket Pipelines build your APK and upload it to the Downloads section automatically. First, let the pipeline build the APK using Gradle and save it as an artifact. Then add a second step to upload the file. The easiest way is to use the official bitbucket-upload-file pipe. In your bitbucket-pipelines.yml, build the APK in the first step and in the next step use the pipe to upload app/build/outputs/apk/release/app-release.apk to Downloads. If you prefer, you can also use curl with an App Password to upload it through Bitbucket’s API. Just store your username and app password as secure variables, then post the file to the Downloads endpoint. This way, every time you push to main or release, the APK will be built and uploaded automatically.
Great answer, Zoya. Using the bitbucket-upload-file pipe with separate build and upload steps is a clean, maintainable approach. Secure variables for API authentication are definitely best practice. I’ve also shared helpful versioning and release resources on my website for teams looking to streamline their deployment process.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.