Skip to content

Commit

Permalink
Merge pull request #103 from TNG/start-release-tags-with-v
Browse files Browse the repository at this point in the history
chore: start release tags with v, e.g. v1.0.0 instead of 1.0.0
  • Loading branch information
alexzurbonsen authored Jan 22, 2025
2 parents 7d8254a + 354a02a commit e61931c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions scripts/bump_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if [[ $# -eq 1 ]]; then
CREATE_COMMIT="false"
echo "No branch name provided. Won't create a commit."
elif [[ $# -eq 2 ]]; then
BRANCH=$2
BRANCH="$2"
CREATE_COMMIT="true"
echo "Branch name provided. Creating a commit."
else
Expand All @@ -26,12 +26,12 @@ else
fi

VERSION_FORMAT='^([0-9]+\.){2}([0-9]+)$'
if [[ ! $1 =~ $VERSION_FORMAT ]]; then
if [[ ! "$1" =~ $VERSION_FORMAT ]]; then
echo "Invalid version format! Version should be in format X.Y.Z"
exit 22
fi

VERSION=$1
VERSION="$1"

echo -e "${VIOLET}Bump version to ${VERSION}.${NC}"
npm version "${VERSION}" --no-git-tag-version
Expand Down
4 changes: 2 additions & 2 deletions scripts/publish_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fi

# publishing requires an NPM access token, that is stored in an
# environment variable with the same name as the one required in .npmrc
NPM_ACCESS_TOKEN=$1
NPM_ACCESS_TOKEN="$1"
VERSION=$(npm pkg get version)

# for prettier printing
Expand All @@ -30,7 +30,7 @@ npm run build
echo -e "\n${VIOLET}Building successful${NC}"

echo -e "\n${VIOLET}Create version tag${NC}"
git tag -a ${VERSION} -m "Release version ${VERSION}"
git tag -a "v${VERSION}" -m "Release version ${VERSION}"
git push --tags

echo -e "\n${VIOLET}Publishing package${NC}"
Expand Down

0 comments on commit e61931c

Please sign in to comment.