diff --git a/.circleci/config.yml b/.circleci/config.yml index ef26c6fba..cef161539 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -115,6 +115,14 @@ jobs: - flutter_sdk.zip - Pods + release: + docker: + - image: cirrusci/flutter + steps: + - checkout + - run: chmod +x ./release.sh + - run: ./release.sh + publish: macos: xcode: "10.1.0" @@ -143,6 +151,13 @@ workflows: branches: only: master - publish: + context: cross-platform + requires: + - hold + filters: + branches: + only: master + - release: context: cross-platform requires: - hold diff --git a/release.sh b/release.sh new file mode 100644 index 000000000..bde9963d8 --- /dev/null +++ b/release.sh @@ -0,0 +1,18 @@ +#!/bin/sh +VERSION=$(egrep -o "version: ([0-9]-*.*)+[0-9]" pubspec.yaml | cut -d ":" -f 2) +if [ ! "${VERSION}" ] || [ -z "${VERSION}" ];then + echo "Instabug: err: Version Number not found." + exit 1 +else + mkdir -p .pub-cache + cat < $HOME/.pub-cache/credentials.json + { + "accessToken":"${ACCESS_TOKEN}", + "refreshToken":"${REFRESH_TOKEN}", + "tokenEndpoint":"https://accounts.google.com/o/oauth2/token", + "scopes":["https://www.googleapis.com/auth/userinfo.email","openid"], + "expiration":${EXPIRATION} + } +EOF + flutter packages pub publish -f +fi \ No newline at end of file