Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Determine the correct branch as an env var #246

Merged
merged 2 commits into from
Mar 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ env:
- PROTOBUF_VERSION=3.17.3
- PROTO_FILES=`find koinos -name '*.proto' && find google -name '*.proto' && find openapiv3 -name '*.proto'`
- COMMIT_SHORT=`git rev-parse --short HEAD`
- BRANCH=`if ! [ -z ${TRAVIS_TAG} ]; then echo -n master; else echo -n ${TRAVIS_BRANCH}; fi`

# This build matric mixes global and build specific build stages to abstract common tasks.
# This build matrix mixes global and build specific build stages to abstract common tasks.
# There are several conventions in place to facilitate this.
#
# 1. The destination repo (e.g. koinos-proto-cpp) is set in the env var DEST_REPO.
Expand Down Expand Up @@ -173,8 +174,8 @@ before_install:
- git clone https://${GITHUB_USER_TOKEN}@github.com/koinos/${DEST_REPO}.git
- pushd $DEST_REPO
- |
if [ "${TRAVIS_BRANCH}" != "master" ] && [ -z "${TRAVIS_TAG}" ]; then
git checkout -b ${TRAVIS_BRANCH}
if [ "${BRANCH}" != "master" ]; then
git checkout -b ${BRANCH}
fi
- popd

Expand All @@ -183,7 +184,7 @@ after_success:
- |
if ! git diff --cached --quiet --exit-code; then
git commit -m "Update for koinos-proto commit ${COMMIT_SHORT}"
git push --force https://${GITHUB_USER_TOKEN}@github.com/koinos/${DEST_REPO}.git ${TRAVIS_BRANCH}
git push --force https://${GITHUB_USER_TOKEN}@github.com/koinos/${DEST_REPO}.git ${BRANCH}
fi
- |
if ! [ -z "${TRAVIS_TAG}" ]; then
Expand Down