Skip to content

Commit 62d3990

Browse files
committed
Added git tag check.
Removed travis github release provider.
1 parent 27b3174 commit 62d3990

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

.travis.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,6 @@ deploy:
5050
repo: "$UPSTREAM_REPO"
5151
branch: "$MASTER_BRANCH"
5252
condition: $TRAVIS_PHP_VERSION = "7.0"
53-
- provider: releases
54-
api_key: "$GITHUB_TOKEN"
55-
file: artifact/$THEMEISLE_REPO.zip
56-
skip_cleanup: true
57-
on:
58-
tags: false
59-
repo: "$UPSTREAM_REPO"
60-
branch: "$MASTER_BRANCH"
61-
condition: $TRAVIS_PHP_VERSION = "7.0"
6253
after_deploy:
6354
- chmod +x bin/deploy.sh
6455
- ". ./bin/deploy.sh"

bin/deploy.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ if ! [ $AFTER_DEPLOY_RUN ] && [ "$TRAVIS_PHP_VERSION" == "7.0" ]; then
1111

1212
git config user.name "selul"
1313
git config user.email ${GITHUB_EMAIL}
14+
git fetch
15+
16+
# Check if we already have a tag with this version.
17+
if ! git rev-parse "v$THEMEISLE_VERSION" >/dev/null 2>&1
18+
then
1419

1520
# Send changelog changes to git.
1621
git checkout $MASTER_BRANCH
@@ -30,7 +35,7 @@ if ! [ $AFTER_DEPLOY_RUN ] && [ "$TRAVIS_PHP_VERSION" == "7.0" ]; then
3035
# to set the body of the release.
3136
API_JSON='{"tag_name": "v'$THEMEISLE_VERSION'","target_commitish": "'$MASTER_BRANCH'","name": "v'$THEMEISLE_VERSION'","body": "'$CHANGES'","draft": false,"prerelease": false}';
3237
curl -s --data "$API_JSON" "https://api.github.com/repos/$UPSTREAM_REPO/releases?access_token="$GITHUB_TOKEN > /dev/null;
33-
38+
fi
3439
# Send update to the store
3540
STORE_JSON='{"version": "'$THEMEISLE_VERSION'","id": "'$THEMEISLE_ID'","body": "'$CHANGES'"}';
3641
curl -s -H "Content-Type: application/json" -H "x-themeisle-auth: $THEMEISLE_AUTH" --data "$STORE_JSON" "$STORE_URL/wp-json/ti-endpoint/v1/update_changelog_new/" > /dev/null

0 commit comments

Comments
 (0)