Skip to content

Commit

Permalink
Merge pull request #160 from tigrisdata/main
Browse files Browse the repository at this point in the history
Beta release
  • Loading branch information
adilansari authored Nov 10, 2022
2 parents 1be8e28 + 9ab5d2b commit 2768627
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 39 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
[
"@semantic-release/exec",
{
"verifyConditionsCmd": "./scripts/verifyReleaseNeeded.sh ${nextRelease.version}",
"publishCmd": "./scripts/publishLatestRelease.sh ${nextRelease.version}"
}
]
Expand Down
29 changes: 27 additions & 2 deletions scripts/publishLatestRelease.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,38 @@
# Temporary script to publish beta releases to @latest dist-tag. This should be removed
# once first stable release is published to @latest dist-tag

# Attempt to publish a new release to @latest tag
# Determine if version @latest dist-tag is behind $1 or not
if [[ -z "$1" ]] ; then
echo 'No argument specified. Exiting...'
echo 'No argument specified, no release needed. Exiting...'
exit 1
fi

NEXT=$1
echo "Next release version: $NEXT"

if [[ "$NEXT" != *"beta"* ]]; then
echo 'Argument is not a valid beta release. Exiting...'
exit 1
fi

NPM_LATEST=$(npm view @tigrisdata/core dist-tags.latest)
echo "npm @latest version is: $NPM_LATEST"

if [[ "$NPM_LATEST" != *"beta"* ]]; then
echo 'Stable release already published to @latest dist-tag'
echo 'These temporary steps can be cleaned up and not needed anymore. Exiting...'
exit 1
fi

if [[ "$NPM_LATEST" == "$NEXT" ]]; then
echo "@latest is already on $NEXT"
echo 'No release needed. Exiting...'
exit 1
fi

echo 'Release needed on @latest dist-tag'

# Attempt to publish a new release to @latest tag
echo "Setting version in package.json to: $NEXT"
VERSION_OUT=$(npm version $NEXT --no-git-tag-version --allow-same-version | tail -n1)

Expand Down
36 changes: 0 additions & 36 deletions scripts/verifyReleaseNeeded.sh

This file was deleted.

0 comments on commit 2768627

Please sign in to comment.