Skip to content

Commit c3f6557

Browse files
committed
Create publish preprelease script
1 parent 9491a16 commit c3f6557

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

scripts/publish-prerelease.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Use the first argument as version or 'v3-prerelease' if not available
6+
version=${1:-'v3-prerelease'}
7+
8+
# Ensure git stage is clear
9+
if [[ $(git status --porcelain) ]]; then
10+
echo "Your git status is not clean.";
11+
exit 1;
12+
else
13+
echo "Git status is clean. Proceeding with the script.";
14+
fi
15+
16+
# Run your commands
17+
rm .changeset/pre.json
18+
19+
echo "Running: pnpm exec changeset version --snapshot $version"
20+
pnpm exec changeset version --snapshot $version
21+
22+
echo "Running: pnpm run build --filter \"@trigger.dev/*\" --filter \"trigger.dev\""
23+
pnpm run build --filter "@trigger.dev/*" --filter "trigger.dev"
24+
25+
echo "Going to run: pnpm exec changeset publish --no-git-tag --snapshot --tag $version"
26+
read -p "Do you wish to continue? (Y/n): " prompt
27+
if [[ $prompt =~ [yY](es)* ]]; then
28+
pnpm exec changeset publish --no-git-tag --snapshot --tag $version
29+
else
30+
echo "Publish command aborted by the user."
31+
exit 1;
32+
fi
33+
34+
# If there were no errors, clear the git stage
35+
echo "Commands ran successfully. Clearing the git stage."
36+
git reset --hard HEAD

0 commit comments

Comments
 (0)