-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #225 from /issues/223
bash script for doing release checklist, resolves #223
- Loading branch information
Showing
9 changed files
with
50 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
### [unreleased] | ||
### 4.3.0 - 2024-05-04 | ||
|
||
#### Added | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/bash | ||
|
||
# Get the last version tag | ||
readonly LAST_VERSION_TAG=$(git describe --abbrev=0 --tags) | ||
|
||
# Prompt user for new version | ||
read -p "Enter the new version number (most recent tag: ${LAST_VERSION_TAG#"v"}): " NEW_VERSION | ||
readonly NEW_VERSION | ||
|
||
# Validate input: Check if the input is a valid version number | ||
if ! [[ $NEW_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
echo "Error: Invalid version number. Please try again with proper semver formatting." | ||
exit 1 | ||
fi | ||
|
||
####################################### | ||
|
||
# Replace [unreleased] placeholders throughout src files | ||
grep -FRl --exclude='*/node_modules/*' --exclude='*/vendor/*' '[unreleased]' src assets | xargs sed -i -e "s/\[unreleased\]/$NEW_VERSION/g" | ||
|
||
# Replace header value in readme.txt for WordPress.org plugin page | ||
sed -i "s/Stable tag: .*/Stable tag: $NEW_VERSION/" readme.txt | ||
|
||
# Replace release heading in changelog.md with specified new version and current date | ||
readonly TODAY=$(date +'%Y-%m-%d') | ||
sed -i "s/### \[unreleased\]/### $NEW_VERSION - $TODAY/" changelog.md | ||
|
||
####################################### | ||
|
||
# Review and confirm changes | ||
echo | ||
echo "Release checklist changes applied." | ||
echo "Please review the changes and confirm this release:" | ||
echo | ||
echo "git status" | ||
echo "git diff" | ||
echo | ||
echo "git commit -m \"bump v$NEW_VERSION\"" | ||
echo "git tag -a \"v$NEW_VERSION\" -m \"see changelog.md\"" | ||
echo "git push --tags" | ||
echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters