Bitbucket Pipelines
Bitbucket keeps files between steps when you list them as artifacts. Build in one step, upload in the next with a Node image.
1. Add your token
Create an API token under Dashboard, Settings, API tokens (Pro and Team). Repository settings, Repository variables, add APPFORSHARE_TOKEN and tick Secured. The CLI reads it from the APPFORSHARE_TOKEN environment variable.
2. bitbucket-pipelines.yml
The share step reads the artifact from the build step and uses the commit message as release notes.
pipelines:
branches:
main:
- step:
name: Build
image: eclipse-temurin:17
script:
- ./gradlew assembleRelease
artifacts:
- app/build/outputs/apk/release/app-release.apk
- step:
name: Share with testers
image: node:22
script:
- npx --yes appforshare upload app/build/outputs/apk/release/app-release.apk --notes "$(git log -1 --pretty=%B)" --channel betaGood to know
- Bitbucket Cloud has no hosted macOS runners; build iOS on a self-hosted macOS runner or another CI and upload from there.
- Add --channel beta to keep one stable link for testers, and --fail-on blocked to stop the pipeline when the store readiness check finds a blocker (exit code 2; the build stays uploaded).
- The command prints the install link. Add --json for url, slug, version and channel as JSON. All options are on Upload from CI.
Questions
- Is there a Bitbucket pipe?
- Not yet. The npx command does the same in one line.
- Does it work with deployment environments?
- Yes. Put the variable on a deployment environment instead of the repository if only that environment should upload.
Other CI systems
GitHub Actions and FastlaneCircleCIGitLab CIJenkinsAzure PipelinesXcode CloudCodemagicBitriseExpo EAS