Compare commits
3 Commits
6400976d19
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
| 5f6d8d8eab | |||
| abf47646a1 | |||
| 99be386004 |
25
.github/actions/bump-version/action.yaml
vendored
25
.github/actions/bump-version/action.yaml
vendored
@@ -38,6 +38,13 @@ runs:
|
||||
id: bump
|
||||
shell: bash
|
||||
run: |
|
||||
EXISTING_TAG="$(git tag --points-at HEAD "v*" | head -n 1)"
|
||||
if [ -n "${EXISTING_TAG}" ]; then
|
||||
echo "Tag ${EXISTING_TAG} already points at this commit; skipping bump."
|
||||
echo "tag=${EXISTING_TAG}" >> "${GITHUB_OUTPUT}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
REF="${GITHUB_REF:-${GITEA_REF}}"
|
||||
BRANCH="${REF#refs/heads/}"
|
||||
git fetch origin "${BRANCH}" --tags
|
||||
@@ -50,7 +57,9 @@ runs:
|
||||
main)
|
||||
COMMIT_MSG="$(git log -1 --pretty=%B)"
|
||||
TARGET_VERSION=""
|
||||
if [[ "${COMMIT_MSG}" =~ release/([0-9]+)\.([0-9]+) ]]; then
|
||||
if [[ "${COMMIT_MSG}" =~ release/v?([0-9]+\.[0-9]+\.[0-9]+) ]]; then
|
||||
TARGET_VERSION="${BASH_REMATCH[1]}"
|
||||
elif [[ "${COMMIT_MSG}" =~ release/([0-9]+)\.([0-9]+) ]]; then
|
||||
TARGET_VERSION="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.0"
|
||||
elif [[ "${COMMIT_MSG}" =~ hotfix/([0-9]+\.[0-9]+\.[0-9]+) ]]; then
|
||||
TARGET_VERSION="${BASH_REMATCH[1]}"
|
||||
@@ -69,8 +78,18 @@ runs:
|
||||
BUMP_CMD="npm version prerelease --preid=dev --no-git-tag-version"
|
||||
;;
|
||||
release*)
|
||||
npm version prerelease --preid=rc-${BRANCH_SAFE} --no-git-tag-version
|
||||
BUMP_CMD="npm version prerelease --preid=rc-${BRANCH_SAFE} --no-git-tag-version"
|
||||
RELEASE_VERSION=""
|
||||
if [[ "${BRANCH}" =~ ^release/v?([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then
|
||||
RELEASE_VERSION="${BASH_REMATCH[1]}"
|
||||
fi
|
||||
|
||||
if [[ -n "${RELEASE_VERSION}" ]]; then
|
||||
npm version "${RELEASE_VERSION}-rc.0" --no-git-tag-version --allow-same-version
|
||||
BUMP_CMD="npm version prerelease --preid=rc --no-git-tag-version"
|
||||
else
|
||||
npm version prerelease --preid=rc-${BRANCH_SAFE} --no-git-tag-version
|
||||
BUMP_CMD="npm version prerelease --preid=rc-${BRANCH_SAFE} --no-git-tag-version"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
npm version prerelease --preid=nightly-${BRANCH_SAFE} --no-git-tag-version
|
||||
|
||||
Reference in New Issue
Block a user