-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublish.sh
More file actions
executable file
·32 lines (24 loc) · 955 Bytes
/
publish.sh
File metadata and controls
executable file
·32 lines (24 loc) · 955 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
# Exit on any error
set -e
# Step 1: Create a changeset (only if there are new changes)
echo "Creating a changeset..."
npx changeset
# Step 2: Version the package and update package.json
echo "Versioning the package..."
npx changeset version
# Step 3: Build the package (if needed, or modify according to your project)
echo "Building the package..."
npm run build
# Step 4: Commit changes (new version, changelog, etc.)
echo "Committing the changes..."
git add . # Add the changes (package.json, changelog, etc.)
git commit -m "chore: update version and changelog" # Commit the changes
# Step 5: Push the changes to GitHub
echo "Pushing changes to GitHub..."
git push origin main # Replace 'main' with your default branch if different
# Step 6: Publish to npm
echo "Publishing package to npm..."
npm publish --access public # Publish to npm
# Step 7: Clean up (optional) - you can add any cleanup steps here if needed
echo "Done!"