Skip to content

Commit 00526f3

Browse files
committed
Update finish release script
1 parent 166d234 commit 00526f3

File tree

2 files changed

+30
-32
lines changed

2 files changed

+30
-32
lines changed

scripts/delete-pre-tags.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
echo "Pruning tags before looking for tags to delete..."
4+
git fetch --prune --prune-tags
5+
6+
PATTERN="@7\.\d\+\.\d\+-pre"
7+
8+
TAGS=$(git tag | grep -e "${PATTERN}")
9+
10+
if [[ $TAGS == "" ]]; then
11+
echo "No tags to delete, exiting"
12+
exit 0
13+
fi
14+
15+
# Delay setting this because if it's set when no tags exist the program exits
16+
# on the TAGS assignment above
17+
set -e
18+
19+
NUM_TAGS=$(git tag | grep -e "${PATTERN}" | wc -l | sed 's/ //g')
20+
TAGS_LINE=$(git tag | grep -e "${PATTERN}" | tr '\n' ' ')
21+
22+
echo ""
23+
echo "Found ${NUM_TAGS} tags to delete. To delete, run the following commands:"
24+
echo ""
25+
echo "git push origin --delete ${TAGS_LINE}"
26+
echo "git fetch --prune --prune-tags"
27+
28+
set +e

scripts/finish-stable-release.sh

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -40,40 +40,10 @@ git push
4040
git branch -d release-next
4141

4242
if [[ -n $(git show-ref refs/heads/changeset-release/release-next) ]]; then
43-
git branch -d changeset-release/release-next
43+
git branch -D changeset-release/release-next
4444
fi
4545

46-
# If this is set when no tags exist the program exits on the TAGS assignment
47-
set +e
48-
49-
echo "Pruning tags before looking for tags to delete:"
50-
git fetch --prune --prune-tags
51-
52-
PATTERN="@7\.\d\+\.\d\+-pre"
53-
54-
# Don't keep around prerelease tags for all packages - only the `react-router` package
55-
TAGS=$(git tag | grep -e "${PATTERN}" | grep -ve "^react-router@")
56-
57-
if [[ $TAGS == "" ]]; then
58-
echo "No tags to delete, exiting"
59-
exit 0
60-
fi
61-
62-
set -e
63-
64-
NUM_TAGS=$(git tag | grep -e "${PATTERN}" | grep -ve "^react-router@" | wc -l | sed 's/ //g')
65-
TAGS_LINE=$(git tag | grep -e "${PATTERN}" | grep -ve "^react-router@" | tr '\n' ' ')
66-
67-
echo "Found ${NUM_TAGS} tags to delete: ${TAGS_LINE}"
68-
69-
echo "To delete, run the following commands:"
70-
echo ""
71-
echo "git push origin --delete ${TAGS_LINE}"
72-
echo "git fetch --prune --prune-tags"
73-
74-
set +e
75-
set +x
76-
46+
./scripts/delete-pre-tags.sh
7747

7848
set +e
7949
set +x

0 commit comments

Comments
 (0)