Skip to content

Commit 4e8fd15

Browse files
alyezzAli Abdelfattah
authored and
Ali Abdelfattah
committed
Fixing CI publish (Instabug#98)
* updates config
1 parent 28d8303 commit 4e8fd15

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

.circleci/config.yml

+15
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ jobs:
115115
- flutter_sdk.zip
116116
- Pods
117117

118+
release:
119+
docker:
120+
- image: cirrusci/flutter
121+
steps:
122+
- checkout
123+
- run: chmod +x ./release.sh
124+
- run: ./release.sh
125+
118126
publish:
119127
macos:
120128
xcode: "10.1.0"
@@ -143,6 +151,13 @@ workflows:
143151
branches:
144152
only: master
145153
- publish:
154+
context: cross-platform
155+
requires:
156+
- hold
157+
filters:
158+
branches:
159+
only: master
160+
- release:
146161
context: cross-platform
147162
requires:
148163
- hold

release.sh

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
fi

0 commit comments

Comments
 (0)