Skip to content

Instantly share code, notes, and snippets.

@james2doyle
Created February 14, 2023 21:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save james2doyle/8d359ec98cd74df7cc35f5236f5897f6 to your computer and use it in GitHub Desktop.
Save james2doyle/8d359ec98cd74df7cc35f5236f5897f6 to your computer and use it in GitHub Desktop.
Bitbucket pipeline file for building Android app apk files with Flutter
# You can run the pipeline image locally using the following command:
# docker run --platform linux/amd64 -it --volume="$PWD:/app" --workdir="/app" --entrypoint=/bin/bash avetkhov/flutter:latest
definitions:
caches:
pub: ~/.pub-cache # $PUB_CACHE default value
flutter: /opt/flutter # flutter sdk path
steps:
- step: &flutter-run
name: Flutter Test
image: avetkhov/flutter:latest
caches:
- pub
- flutter
script:
- flutter channel master
- flutter upgrade --force
- flutter precache
- flutter pub get
- flutter test
pipelines:
default:
- step: *flutter-run
- step:
name: Build Android
image: avetkhov/flutter:latest
caches:
- pub
- flutter
script:
- flutter channel master
- flutter upgrade --force
- flutter precache
- flutter pub get
- flutter build apk --debug
artifacts:
- build/app/outputs/flutter-apk/**
- step:
name: Create Download
deployment: Test
script:
- pipe: atlassian/bitbucket-upload-file:0.3.4
variables:
BITBUCKET_USERNAME: $BITBUCKET_USERNAME
BITBUCKET_APP_PASSWORD: $BITBUCKET_APP_PASSWORD # needs Repo Read and Write permission
# uploaded to https://bitbucket.org/{repo_org}/{repo_name}/downloads/
FILENAME: "build/app/outputs/flutter-apk/*.apk"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment