Skip to content

Commit

Permalink
💎 Bump to v0.0.3-alpha.1
Browse files Browse the repository at this point in the history
1) Added circleci config for auto releases on mater
2) Added release.sh script that creates a release on github and releases the package on pub
  • Loading branch information
alyezz authored Mar 21, 2019
1 parent 6b0af45 commit ed4112b
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 3 deletions.
30 changes: 28 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2

jobs:
build:
build:
docker:
- image: cirrusci/flutter
steps:
Expand All @@ -11,4 +11,30 @@ jobs:
- run: flutter doctor
- run: pub get
- run: flutter test
- run: dartanalyzer --options analysis_options.yaml --fatal-warnings lib
- run: dartanalyzer --options analysis_options.yaml --fatal-warnings lib

release:
docker:
- image: cirrusci/flutter
steps:
- checkout
- run: ./release.sh

workflows:
version: 2
build-test-and-approval-deploy:
jobs:
- build
- hold:
type: approval
requires:
- build
filters:
branches:
only: master
- release:
requires:
- hold
filters:
branches:
only: master
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: instabug_flutter
version: 0.0.1-alpha.1
version: 0.0.3-alpha.1
description: >-
Instabug is an in-app feedback and bug reporting tool for mobile apps.
With just a simple shake, your users or beta testers can report bugs or
Expand Down
31 changes: 31 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/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 <<EOF > $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

OWNER="Instabug"
REPOSITORY="Instabug-Flutter"
ACCESS_TOKEN=${RELEASE_GITHUB_TOKEN}
VERSION=$(echo ${VERSION} | sed 's/ //1')
curl --data '{"tag_name": "'$VERSION'",
"target_commitish": "master",
"name": "'$VERSION'",
"body": "Release of version '$VERSION'",
"draft": false,
"prerelease": false}' https://api.github.com/repos/$OWNER/$REPOSITORY/releases?access_token=$ACCESS_TOKEN
echo "https://api.github.com/repos/$OWNER/$REPOSITORY/releases?access_token=$ACCESS_TOKEN"
fi

0 comments on commit ed4112b

Please sign in to comment.