pfffz
Some checks failed
Bump Version (via reusable workflow) / bump-version (push) Failing after 7s
Some checks failed
Bump Version (via reusable workflow) / bump-version (push) Failing after 7s
This commit is contained in:
35
.github/workflows/bump-version.yaml
vendored
35
.github/workflows/bump-version.yaml
vendored
@@ -59,26 +59,43 @@ jobs:
|
||||
fi
|
||||
|
||||
if [[ -n "${TARGET_VERSION}" ]]; then
|
||||
if git rev-parse -q --verify "refs/tags/v${TARGET_VERSION}" >/dev/null; then
|
||||
echo "Tag v${TARGET_VERSION} already exists; skipping version bump."
|
||||
exit 0
|
||||
fi
|
||||
TAG="$(npm version "${TARGET_VERSION}" -m "update version: %s")"
|
||||
npm version "${TARGET_VERSION}" --no-git-tag-version --allow-same-version
|
||||
BUMP_CMD="npm version patch --no-git-tag-version"
|
||||
else
|
||||
TAG="$(npm version patch -m "update version: %s")"
|
||||
npm version patch --no-git-tag-version
|
||||
BUMP_CMD="npm version patch --no-git-tag-version"
|
||||
fi
|
||||
;;
|
||||
develop)
|
||||
TAG="$(npm version prerelease --preid=dev -m "update version: %s")"
|
||||
npm version prerelease --preid=dev --no-git-tag-version
|
||||
BUMP_CMD="npm version prerelease --preid=dev --no-git-tag-version"
|
||||
;;
|
||||
release*)
|
||||
TAG="$(npm version prerelease --preid=rc-${BRANCH_SAFE} -m "update version: %s")"
|
||||
npm version prerelease --preid=rc-${BRANCH_SAFE} --no-git-tag-version
|
||||
BUMP_CMD="npm version prerelease --preid=rc-${BRANCH_SAFE} --no-git-tag-version"
|
||||
;;
|
||||
*)
|
||||
TAG="$(npm version prerelease --preid=nightly-${BRANCH_SAFE} -m "update version: %s")"
|
||||
npm version prerelease --preid=nightly-${BRANCH_SAFE} --no-git-tag-version
|
||||
BUMP_CMD="npm version prerelease --preid=nightly-${BRANCH_SAFE} --no-git-tag-version"
|
||||
;;
|
||||
esac
|
||||
|
||||
VERSION="$(node -p "require('./package.json').version")"
|
||||
while git rev-parse -q --verify "refs/tags/v${VERSION}" >/dev/null; do
|
||||
echo "Tag v${VERSION} already exists; trying next version."
|
||||
${BUMP_CMD}
|
||||
VERSION="$(node -p "require('./package.json').version")"
|
||||
done
|
||||
|
||||
if git diff --quiet; then
|
||||
echo "No version file changes; tagging current commit."
|
||||
else
|
||||
git add package.json package-lock.json 2>/dev/null || true
|
||||
git commit -m "update version: v${VERSION}"
|
||||
fi
|
||||
TAG="v${VERSION}"
|
||||
git tag "${TAG}"
|
||||
|
||||
git push origin HEAD
|
||||
git push origin "${TAG}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user