Skip to content

Commit

Permalink
chore: release version 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mdy-m committed Sep 15, 2024
1 parent bb76660 commit 0766a45
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
#!/bin/bash
set -e

# Run the build script
npm run build

# Get the version from package.json
VERSION=$(node -p "require('./package.json').version")

# Get the changelog content
CHANGELOG_CONTENT=$(cat docs/CHANGELOG.md)
git add .
git tag -a "v${VERSION}" -m "Release ${VERSION}: ${CHANGELOG_CONTENT}"
git commit -m "chore: release version ${VERSION}"
git push origin main --tags
npm publish --access public

# Check for changes in the working directory
if [ -n "$(git status --porcelain)" ]; then
# There are changes to commit
git add .
git commit -m "chore: release version ${VERSION}"

# Tag the commit with the new version
git tag -a "v${VERSION}" -m "Release ${VERSION}: ${CHANGELOG_CONTENT}"

# Push the commit and the tag
git push origin main --tags
else
echo "No changes to commit."
fi

# Publish the package
npm publish --access public

0 comments on commit 0766a45

Please sign in to comment.