Skip to content

Avoid double publishing on commit + tag push #118

@dwijnand

Description

@dwijnand

A long-standing issue with sbt-dynver and publishing on Travis CI is that when you create a commit (e.g. bump the version number in the README) and a tag, and push both, then Travis CI will kick-off two builds and one will fail (race condition to Bintray, for example).

Found this code to avoid it:

	if [ -z "$TRAVIS_TAG" ]; then
		TRAVIS_TAG=$( git -C "$TRAVIS_BUILD_DIR" tag --points-at )
		if [ -n "$TRAVIS_TAG" ]; then
			echo "Found future tag \"${TRAVIS_TAG}\", skipping."
			exit 0
		fi
	fi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions