Skip to content

Commit ed4112b

Browse files
authored
💎 Bump to v0.0.3-alpha.1
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
1 parent 6b0af45 commit ed4112b

File tree

3 files changed

+60
-3
lines changed

3 files changed

+60
-3
lines changed

.circleci/config.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2
22

33
jobs:
4-
build:
4+
build:
55
docker:
66
- image: cirrusci/flutter
77
steps:
@@ -11,4 +11,30 @@ jobs:
1111
- run: flutter doctor
1212
- run: pub get
1313
- run: flutter test
14-
- run: dartanalyzer --options analysis_options.yaml --fatal-warnings lib
14+
- run: dartanalyzer --options analysis_options.yaml --fatal-warnings lib
15+
16+
release:
17+
docker:
18+
- image: cirrusci/flutter
19+
steps:
20+
- checkout
21+
- run: ./release.sh
22+
23+
workflows:
24+
version: 2
25+
build-test-and-approval-deploy:
26+
jobs:
27+
- build
28+
- hold:
29+
type: approval
30+
requires:
31+
- build
32+
filters:
33+
branches:
34+
only: master
35+
- release:
36+
requires:
37+
- hold
38+
filters:
39+
branches:
40+
only: master

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: instabug_flutter
2-
version: 0.0.1-alpha.1
2+
version: 0.0.3-alpha.1
33
description: >-
44
Instabug is an in-app feedback and bug reporting tool for mobile apps.
55
With just a simple shake, your users or beta testers can report bugs or

release.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/sh
2+
VERSION=$(egrep -o "version: ([0-9]-*.*)+[0-9]" pubspec.yaml | cut -d ":" -f 2)
3+
if [ ! "${VERSION}" ] || [ -z "${VERSION}" ];then
4+
echo "Instabug: err: Version Number not found."
5+
exit 1
6+
else
7+
mkdir -p .pub-cache
8+
cat <<EOF > $HOME/.pub-cache/credentials.json
9+
{
10+
"accessToken":"${ACCESS_TOKEN}",
11+
"refreshToken":"${REFRESH_TOKEN}",
12+
"tokenEndpoint":"https://accounts.google.com/o/oauth2/token",
13+
"scopes":["https://www.googleapis.com/auth/userinfo.email","openid"],
14+
"expiration":${EXPIRATION}
15+
}
16+
EOF
17+
flutter packages pub publish -f
18+
19+
OWNER="Instabug"
20+
REPOSITORY="Instabug-Flutter"
21+
ACCESS_TOKEN=${RELEASE_GITHUB_TOKEN}
22+
VERSION=$(echo ${VERSION} | sed 's/ //1')
23+
curl --data '{"tag_name": "'$VERSION'",
24+
"target_commitish": "master",
25+
"name": "'$VERSION'",
26+
"body": "Release of version '$VERSION'",
27+
"draft": false,
28+
"prerelease": false}' https://api.github.com/repos/$OWNER/$REPOSITORY/releases?access_token=$ACCESS_TOKEN
29+
echo "https://api.github.com/repos/$OWNER/$REPOSITORY/releases?access_token=$ACCESS_TOKEN"
30+
fi
31+

0 commit comments

Comments
 (0)