Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to deploy generated APK to Bitbucket Downloads using Pipelines?

Kassy Shane
Contributor
October 5, 2025

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.

2 answers

1 accepted

1 vote
Answer accepted
Zoya Khan
October 12, 2025

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.

Kassy Shane
Contributor
October 12, 2025

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.

Like Zoya Khan likes this
Zoya Khan
October 12, 2025

thanks kassy! i am glad that my answer helped you :)

Kassy Shane
Contributor
October 12, 2025

welcome

0 votes
John smith
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 2, 2026

Yeah, this setup is actually pretty solid 👍 — Bitbucket Pipelines makes APK automation much easier once it’s configured properly.

I’ve used a similar flow where the APK is generated using assembleRelease, then automatically uploaded after the build completes. Since everything runs inside the pipeline, it doesn’t matter that the APK is in .gitignore.

One thing that helped me a lot while working with these kinds of builds is having a simple reference guide for Android APK build + deployment issues (especially Gradle output paths, signing, and pipeline variables). I’ve shared a basic walkthrough here for anyone who gets stuck during setup — busimulaterindonesia.com

It really helps when you’re dealing with CI/CD for the first time or debugging why the APK isn’t getting generated or uploaded correctly.

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events