Skip to content

Commit 7ba98ff

Browse files
authored
Merge pull request #67 from rchicoli/release-bulk
ci: add major and feature env to the release script
2 parents 70aa5b7 + 754b9e7 commit 7ba98ff

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ matrix:
5757
if: type IN (pull_request)
5858

5959
- stage: release
60+
# env: MAJOR_RELEASE=true
61+
# it would be nice to map github labels instead
62+
env: RELEASE_TAG=0.3.0
6063
if: type IN (push)
6164
script:
6265
- ./scripts/git-release.sh

scripts/git-release.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,19 @@ git fetch --tags
99
LAST_TAG="$(git describe --tags "$(git rev-list --tags --max-count=1)" 2>/dev/null)"
1010

1111
# create a new tag version
12-
NEW_TAG="$(awk -F. '{printf "%d.%d.%d", $1, $2, $3+1}' <(echo "$LAST_TAG"))"
12+
if [[ -n "${RELEASE_TAG:+x}" ]]; then
13+
NEW_TAG="$RELEASE_TAG"
14+
elif [[ -n "${MAJOR_RELEASE:+x}" ]]; then
15+
NEW_TAG="$(awk -F. '{printf "%d.0.0", $1+1 }' <(echo "$LAST_TAG"))"
16+
elif [[ -n "${FEATURE_RELEASE:+x}" ]]; then
17+
NEW_TAG="$(awk -F. '{printf "%d.%d.0", $1, $2+1 }' <(echo "$LAST_TAG"))"
18+
else
19+
NEW_TAG="$(awk -F. '{printf "%d.%d.%d", $1, $2, $3+1}' <(echo "$LAST_TAG"))"
20+
fi
21+
22+
if [[ "$NEW_TAG" == "$LAST_TAG" ]]; then
23+
NEW_TAG="$(awk -F. '{printf "%d.%d.%d", $1, $2, $3+1}' <(echo "$NEW_TAG"))"
24+
fi
1325

1426
export PLUGIN_TAG="$NEW_TAG"
1527
make
@@ -19,6 +31,8 @@ make push
1931

2032
# git log --oneline "${LAST_TAG}..HEAD"
2133

34+
# FIXME: travis deploy extension cuts multiple commit lines
35+
# possible solution: remove deploy extension and add git push tag command
2236
git tag -a "$NEW_TAG" -m "$(git log --oneline ${LAST_TAG}..HEAD)"
2337

2438
git tag -n100

0 commit comments

Comments
 (0)