Skip to content

Instantly share code, notes, and snippets.

@robertohuertasm
Last active January 20, 2019 19:37
Show Gist options
  • Save robertohuertasm/2182868d7be8a8a47429e255e5fdfd73 to your computer and use it in GitHub Desktop.
Save robertohuertasm/2182868d7be8a8a47429e255e5fdfd73 to your computer and use it in GitHub Desktop.
publish_flutter_package
language: dart
dart:
- stable
os:
- linux
sudo: false
addons:
apt:
sources:
- ubuntu-toolchain-r-test # you need this source to get the right version of libstdc++6
packages:
- libstdc++6
- fonts-droid
install:
- echo 'Avoid default Travis CI install step' # this is to avoid an error with pub in Travis
before_script:
- cd ..
- git clone https://github.com/flutter/flutter.git
- export PATH=`pwd`/flutter/bin:`pwd`/flutter/bin/cache/dart-sdk/bin:$PATH
- flutter doctor
script:
- cd $TRAVIS_BUILD_DIR
- flutter packages get
- flutter analyze --no-pub --no-current-package lib
- flutter test
- flutter packages pub publish --dry-run
before_deploy:
- chmod +x ./.travis/publish.sh # giving execution permissions to this file to avoid error 127.
- mv ./.travis ../ # moving this out the publication folder as we don't want to publish it.
deploy:
provider: script
skip_cleanup: true
script: '../.travis/publish.sh'
on:
tags: true
cache:
directories:
- $HOME/.pub-cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment