forked from triggerdotdev/trigger.dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublish-prerelease.sh
More file actions
executable file
·37 lines (29 loc) · 1.17 KB
/
publish-prerelease.sh
File metadata and controls
executable file
·37 lines (29 loc) · 1.17 KB
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
33
34
35
36
37
#!/bin/bash
set -e
# Use the first argument as version or 'v3-prerelease' if not available
version=${1:-'v3-prerelease'}
# Ensure git stage is clear
if [[ $(git status --porcelain) ]]; then
echo "Your git status is not clean. Please commit your changes before running this script.";
echo "To reset all your changes, run this instead: git reset --hard HEAD"
exit 1;
else
echo "Git status is clean. Proceeding with the script.";
fi
# Run your commands
rm .changeset/pre.json
echo "Running: pnpm exec changeset version --snapshot $version"
pnpm exec changeset version --snapshot $version
echo "Running: pnpm run build --filter \"@trigger.dev/*\" --filter \"trigger.dev\""
pnpm run build --filter "@trigger.dev/*" --filter "trigger.dev"
echo "Going to run: pnpm exec changeset publish --no-git-tag --snapshot --tag $version"
read -p "Do you wish to continue? (y/N): " prompt
if [[ $prompt =~ [yY](es)* ]]; then
pnpm exec changeset publish --no-git-tag --snapshot --tag $version
else
echo "Publish command aborted by the user."
exit 1;
fi
# If there were no errors, clear the git stage
echo "Commands ran successfully. Clearing the git stage."
git reset --hard HEAD