Skip to content
This repository has been archived by the owner on Jan 17, 2022. It is now read-only.

Commit

Permalink
ci(circle): Fix release script (#82)
Browse files Browse the repository at this point in the history
Closes #81 [hopefully]
  • Loading branch information
k911 authored Nov 30, 2019
1 parent 92285ac commit 542a954
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ jobs:
<<: *docker-release
environment:
DRY_RUN: "1"
GH_TOKEN: "xxxx"

workflows:
version: 2.1
Expand Down
20 changes: 11 additions & 9 deletions .circleci/release-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,18 @@ else
fi

# Push commit and tag
if [ "0" = "$DRY_RUN" ]; then
GH_TOKEN="${GH_TOKEN:?"Provide \"GH_TOKEN\" variable with GitHub Personal Access Token"}"
git remote add authorized "https://${GH_COMMITER_NAME}:${GH_TOKEN}@github.com/${GH_REPOSITORY}.git"
REVS="$RELEASE_TAG HEAD:master HEAD:develop"
for REV in $REVS
do
GH_TOKEN="${GH_TOKEN:?"Provide \"GH_TOKEN\" variable with GitHub Personal Access Token"}"
REVS="$RELEASE_TAG HEAD:master HEAD:develop"

git remote add authorized "https://${GH_COMMITER_NAME}:${GH_TOKEN}@github.com/${GH_REPOSITORY}.git"
for REV in $REVS; do
if [ "0" = "$DRY_RUN" ]; then
git push authorized "$REV"
done
git remote remove authorized
fi
else
echo "Pushing $REV.."
fi
done
git remote remove authorized

# Make github release
GH_RELEASE_DRAFT="${GH_RELEASE_DRAFT:-false}"
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ services:
GH_REPOSITORY: "${GH_REPOSITORY:-k911/swoole-bundle}"
GH_COMMITER_NAME: "${GH_COMMITER_NAME:-k911}"
GH_COMMITER_EMAIL: "${GH_COMMITER_EMAIL:-konradobal@gmail.com}"
GH_TOKEN: "${GH_TOKEN:-}"
GH_TOKEN: "${GH_TOKEN:-xxxxxxxx}"
GH_RELEASE_DRAFT: "${GH_RELEASE_DRAFT:-false}"
GH_RELEASE_PRERELEASE: "${GH_RELEASE_PRERELEASE:-false}"
volumes:
Expand Down

0 comments on commit 542a954

Please sign in to comment.