Skip to content

Commit 6f98fa1

Browse files
committed
Updated scripts to release when a new tag is noticed
1 parent 66feca0 commit 6f98fa1

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ android {
3030
applicationId "com.stealthcotper.networktools"
3131
minSdkVersion minSdkVer
3232
targetSdkVersion targetSdkVer
33-
versionCode 8
34-
versionName "0.1.12"
33+
versionCode 9
34+
versionName "0.1.14"
3535
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
3636
}
3737

library/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
defaultConfig {
88
minSdkVersion minSdkVer
99
targetSdkVersion targetSdkVer
10-
versionCode 4
11-
versionName "0.2.2"
10+
versionCode 5
11+
versionName "0.2.30"
1212
}
1313
buildTypes {
1414
release {

scripts/config.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ GITHUB_RELEASE_DESC="This release was automatically generated by the CI server"
1414
GITHUB_RELEASE_URL="https://api.github.com/repos/stealthcopter/AndroidNetworkTools/releases"
1515
GITHUB_RELEASE_TOKEN=$ANDROID_NETWORK_TOOLS_GITHUB_RELEASE_TOKEN
1616

17+
# Git info
18+
GIT_TAG=`git name-rev --name-only --tags HEAD`
1719
GIT_COMMIT_DESC=`git log -n 1 $CIRCLE_SHA1`
1820
GIT_CURRENT_BRANCH=`git rev-parse --abbrev-ref HEAD`
1921

@@ -32,4 +34,4 @@ function webhook {
3234

3335
curl -X POST --data-urlencode 'payload={"channel": "'"$SLACK_CHANNEL"'", "username": "CirclCI Deployment Bot", "text": "*'"$APP_NAME"'* version *'"$version"'* <'"https://github.com/scottyab/rootbeer/commits/$git_hash"'|'"$git_hash"'> '"$message"'", "icon_url": "'"$ICON_URL"'"}' $SLACK_WEBHOOK_URL
3436

35-
}
37+
}

scripts/github-release.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,15 @@ function create_github_release {
2121
# exit 0
2222
# fi
2323

24-
if [[ $GIT_COMMIT_DESC == *"#RELEASE"* ]]; then
25-
echo "Creating github release"
24+
# This will push a github release every time a new tag is pushed
25+
# you should ensure tags are push with commits by doing the following:
26+
# git config --global push.followTags true
27+
28+
if [[ $GIT_COMMIT_DESC != *"undefined"* ]]; then
29+
echo "Creating github release for tag $GIT_TAG"
2630
if create_github_release $GITHUB_RELEASE_MODULE; then
27-
webhook $GITHUB_RELEASE_MODULE "Created github release"
31+
webhook $GITHUB_RELEASE_MODULE "Created github release for tag $TAG"
2832
else
29-
webhook $GITHUB_RELEASE_MODULE "Failed to create github release :("
33+
webhook $GITHUB_RELEASE_MODULE "Failed to create github release for tag $TAG :("
3034
fi
31-
fi
35+
fi

0 commit comments

Comments
 (0)