Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/.husky
/.wordpress-org
/assets
/bin
/gulp-tasks
/node_modules
/tests
Expand Down
93 changes: 70 additions & 23 deletions CHANGELOG.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ New releases are targeted based on number and severity of changes along with hum
### Release instructions

1. Branch: Starting from `develop`, cut a release branch named `release/X.Y.Z` for your changes.
2. Version bump: Bump the version number in `simple-podcasting.php`, `package-lock.json`, `package.json`, and `readme.txt` if it does not already reflect the version being released. Update both the plugin "Version:" property and the plugin `PODCASTING_VERSION` constant in `simple-podcasting.php`.
3. Changelog: Add/update the changelog in both `CHANGELOG.md` and `readme.txt`.
2. Version bump: Run `bin/version-bump.sh <major|minor|patch>` to bump the version number in `package.json`, `package-lock.json`, `readme.txt`, and `simple-podcasting.php` if it does not already reflect the version being released. In `simple-podcasting.php` update the plugin `PODCASTING_VERSION` constant.
3. Changelog: Populate the changelog entries in `readme.txt` and `CHANGELOG.md` with the log and to include the date of release.
4. Props: update `CREDITS.md` with any new contributors, confirm maintainers are accurate.
5. New files: Check to be sure any new files/paths that are unnecessary in the production version are included in `.distignore`.
6. Readme updates: Make any other readme changes as necessary. `README.md` is geared toward GitHub and `readme.txt` contains WordPress.org-specific content. The two are slightly different.
Expand Down
2 changes: 1 addition & 1 deletion CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The following individuals are responsible for curating the list of issues, respo

Thank you to all the people who have already contributed to this repository via bug reports, code, design, ideas, project management, translation, testing, etc.

[Adam Silverstein (@adamsilverstein)](https://github.com/adamsilverstein), [Helen Hou-Sandi (@helen)](https://github.com/helen), [Ryan Welcher (@ryanwelcher)](https://github.com/ryanwelcher), [David Chandra Purnama (@turtlepod)](https://github.com/turtlepod), [Oscar Sanchez S. (@oscarssanchez)](https://github.com/oscarssanchez), [Jon Christensen (@Firestorm980)](https://github.com/Firestorm980), [Jeffrey Paul (@jeffpaul)](https://github.com/jeffpaul), [Noah Halstead (@nhalstead)](https://github.com/nhalstead), [Matthew Haines-Young (@mattheu)](https://github.com/mattheu), [Tung Du (@dinhtungdu)](https://github.com/dinhtungdu), [David Chabbi](https://www.linkedin.com/in/david-chabbi-985719b4/), [Pablo Amato (@pabamato)](https://github.com/pabamato), [(@monomo111)](https://github.com/monomo111), [Jake Goldman (@jakemgold)](https://github.com/jakemgold), [Mark Jaquith (@markjaquith)](https://github.com/markjaquith), [Riad Benguella (@youknowriad)](https://github.com/youknowriad), [Mészáros Róbert (@meszarosrob)](https://github.com/meszarosrob), [Max Lyuchin (@cadic)](https://github.com/cadic), [Dharmesh Patel (@iamdharmesh)](https://github.com/iamdharmesh), [Darin Kotter (@dkotter)](https://github.com/dkotter), [Peter Wilson (@peterwilsoncc)](https://github.com/peterwilsoncc), [Felipe Elia (@felipeelia)](https://github.com/felipeelia), [Mehidi Hassan (@mehidi258)](https://github.com/mehidi258), [Tom J Nowell (@tomjn)](https://github.com/tomjn), [David Towoju (@davexpression)](https://github.com/davexpression), [Quamruz Zaman (@zamanq)](https://github.com/zamanq), [Debashish (@dchucks)](https://github.com/dchucks), [(@supersmo)](https://github.com/supersmo), [Jayedul Kabir (@jayedul)](https://github.com/jayedul), [Faisal Alvi (@faisal-alvi)](https://github.com/faisal-alvi), [Vikram Mopharty (@vikrampm1)](https://github.com/vikrampm1), [Siddharth Thevaril (@Sidsector9)](https://github.com/Sidsector9), [Nicolas Knight (@Nicolas-knight)](https://github.com/Nicolas-knight), [Jonathan Netek (@jnetek)](https://github.com/jnetek), [Mehul Gohil (@mehul0810)](https://github.com/mehul0810), [Nate Conley (@nateconley)](https://github.com/nateconley), [Ajay Maurya (@ajmaurya99)](https://github.com/ajmaurya99), [Nickolas Kola (@nickolas-kola)](https://github.com/nickolas-kola), [Ahamed Arshad Azmi (@achchu93)](https://github.com/achchu93), [Ivan Ivanić (@Spoygg)](https://github.com/Spoygg), [Garth Gutenberg (@ggutenberg)](https://github.com/ggutenberg), [Ravinder Kumar (@ravinderk)](https://github.com/ravinderk), [Konstantinos Galanakis (@kmgalanakis)](https://github.com/kmgalanakis), [Dependabot (@dependabot)](https://github.com/apps/dependabot), [Sumit Bagthariya (@qasumitbagthariya)](https://github.com/qasumitbagthariya), [Shazahan Kabir Saju (@sksaju)](https://github.com/sksaju), [Kirtan Gajjar (@kirtangajjar)](https://github.com/kirtangajjar), [Chetra Chann (@channchetra)](https://github.com/channchetra), [James Burgos (@jamesburgos)](https://github.com/jamesburgos), [Martin Burch (@martinburch)](https://github.com/martinburch), [Peter Sorensen (@psorensen)](https://github.com/psorensen), [Barney Jeffries (@barneyjeffries)](https://github.com/barneyjeffries), [Gus Austin (@gusaus)](https://github.com/gusaus), [Sonali Desai (@sonali886)](https://github.com/sonali886), [Gabriel Glogoški (@gabriel-glo)](https://github.com/gabriel-glo), [David Godleman (@godleman)](https://github.com/godleman), [Sudar Muthu (@sudar)](https://github.com/sudar), [David Bowman (@dabowman)](https://github.com/dabowman).
[Adam Silverstein (@adamsilverstein)](https://github.com/adamsilverstein), [Helen Hou-Sandi (@helen)](https://github.com/helen), [Ryan Welcher (@ryanwelcher)](https://github.com/ryanwelcher), [David Chandra Purnama (@turtlepod)](https://github.com/turtlepod), [Oscar Sanchez S. (@oscarssanchez)](https://github.com/oscarssanchez), [Jon Christensen (@Firestorm980)](https://github.com/Firestorm980), [Jeffrey Paul (@jeffpaul)](https://github.com/jeffpaul), [Noah Halstead (@nhalstead)](https://github.com/nhalstead), [Matthew Haines-Young (@mattheu)](https://github.com/mattheu), [Tung Du (@dinhtungdu)](https://github.com/dinhtungdu), [David Chabbi](https://www.linkedin.com/in/david-chabbi-985719b4/), [Pablo Amato (@pabamato)](https://github.com/pabamato), [(@monomo111)](https://github.com/monomo111), [Jake Goldman (@jakemgold)](https://github.com/jakemgold), [Mark Jaquith (@markjaquith)](https://github.com/markjaquith), [Riad Benguella (@youknowriad)](https://github.com/youknowriad), [Mészáros Róbert (@meszarosrob)](https://github.com/meszarosrob), [Max Lyuchin (@cadic)](https://github.com/cadic), [Dharmesh Patel (@iamdharmesh)](https://github.com/iamdharmesh), [Darin Kotter (@dkotter)](https://github.com/dkotter), [Peter Wilson (@peterwilsoncc)](https://github.com/peterwilsoncc), [Felipe Elia (@felipeelia)](https://github.com/felipeelia), [Mehidi Hassan (@mehidi258)](https://github.com/mehidi258), [Tom J Nowell (@tomjn)](https://github.com/tomjn), [David Towoju (@davexpression)](https://github.com/davexpression), [Quamruz Zaman (@zamanq)](https://github.com/zamanq), [Debashish (@dchucks)](https://github.com/dchucks), [(@supersmo)](https://github.com/supersmo), [Jayedul Kabir (@jayedul)](https://github.com/jayedul), [Faisal Alvi (@faisal-alvi)](https://github.com/faisal-alvi), [Vikram Mopharty (@vikrampm1)](https://github.com/vikrampm1), [Siddharth Thevaril (@Sidsector9)](https://github.com/Sidsector9), [Nicolas Knight (@Nicolas-knight)](https://github.com/Nicolas-knight), [Jonathan Netek (@jnetek)](https://github.com/jnetek), [Mehul Gohil (@mehul0810)](https://github.com/mehul0810), [Nate Conley (@nateconley)](https://github.com/nateconley), [Ajay Maurya (@ajmaurya99)](https://github.com/ajmaurya99), [Nickolas Kola (@nickolas-kola)](https://github.com/nickolas-kola), [Ahamed Arshad Azmi (@achchu93)](https://github.com/achchu93), [Ivan Ivanić (@Spoygg)](https://github.com/Spoygg), [Garth Gutenberg (@ggutenberg)](https://github.com/ggutenberg), [Ravinder Kumar (@ravinderk)](https://github.com/ravinderk), [Konstantinos Galanakis (@kmgalanakis)](https://github.com/kmgalanakis), [Dependabot (@dependabot)](https://github.com/apps/dependabot), [Sumit Bagthariya (@qasumitbagthariya)](https://github.com/qasumitbagthariya), [Shazahan Kabir Saju (@sksaju)](https://github.com/sksaju), [Kirtan Gajjar (@kirtangajjar)](https://github.com/kirtangajjar), [Chetra Chann (@channchetra)](https://github.com/channchetra), [James Burgos (@jamesburgos)](https://github.com/jamesburgos), [Martin Burch (@martinburch)](https://github.com/martinburch), [Peter Sorensen (@psorensen)](https://github.com/psorensen), [Barney Jeffries (@barneyjeffries)](https://github.com/barneyjeffries), [Gus Austin (@gusaus)](https://github.com/gusaus), [Sonali Desai (@sonali886)](https://github.com/sonali886), [Gabriel Glogoški (@gabriel-glo)](https://github.com/gabriel-glo), [David Godleman (@godleman)](https://github.com/godleman), [Sudar Muthu (@sudar)](https://github.com/sudar), [David Bowman (@dabowman)](https://github.com/dabowman), [Ben Marshall (@bmarshall511)](https://github.com/bmarshall511), [Jeffrey Carandang (@phpbits)](https://github.com/phpbits), [Sanket Parmar (@sanketio)](https://github.com/sanketio), [Wade Bekker (@wadebekker)](https://github.com/wadebekker).

## Libraries

Expand Down
144 changes: 144 additions & 0 deletions bin/version-bump.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
#!/usr/bin/env bash

set -euo pipefail

required_commands=(awk dirname grep mktemp mv node npm perl)
missing_commands=()

for required_command in "${required_commands[@]}"; do
if ! command -v "$required_command" >/dev/null 2>&1; then
missing_commands+=("$required_command")
fi
done

if (( ${#missing_commands[@]} > 0 )); then
echo "Missing required command(s): ${missing_commands[*]}" >&2
echo "Please install the missing command(s) and try again." >&2
exit 1
fi

if [[ $# -ne 1 ]]; then
echo "Usage: $0 <major|minor|patch>" >&2
exit 1
fi

bump_type="$1"

case "$bump_type" in
major|minor|patch)
;;
*)
echo "Invalid bump type: $bump_type" >&2
echo "Expected one of: major, minor, patch" >&2
exit 1
;;
esac

script_dir="$(cd "$(dirname "$0")" && pwd)"
repo_dir="$(cd "$script_dir/.." && pwd)"

cd "$repo_dir"

for required_file in readme.txt simple-podcasting.php package.json package-lock.json CHANGELOG.md; do
if [[ ! -f "$required_file" ]]; then
echo "Missing required file: $required_file" >&2
exit 1
fi
done

current_version="$(node -p "require('./package.json').version")"

if [[ -z "$current_version" ]]; then
echo "Unable to determine current version from package.json" >&2
exit 1
fi

next_version="$(node -e "const [major, minor, patch] = require('./package.json').version.split('.').map(Number); const bump = process.argv[1]; const next = { major: [major + 1, 0, 0], minor: [major, minor + 1, 0], patch: [major, minor, patch + 1] }[bump]; if (!next || next.some(Number.isNaN)) { process.exit(1); } process.stdout.write(next.join('.'));" "$bump_type")"

if [[ -z "$next_version" ]]; then
echo "Unable to calculate next version" >&2
exit 1
fi

if grep -Eq "^## \[$next_version\]" CHANGELOG.md; then
echo "Changelog already contains version $next_version" >&2
exit 1
fi

if grep -Eq "^\[$next_version\]: https://github.com/10up/simple-podcasting/compare/" CHANGELOG.md; then
echo "Changelog footer already contains version $next_version" >&2
exit 1
fi

if grep -Eq "^= $next_version( - .*)? =$" readme.txt; then
echo "readme.txt changelog already contains version $next_version" >&2
exit 1
fi

if ! grep -Fq "[View historical changelog details here]" readme.txt; then
echo "Unable to find historical changelog link in readme.txt" >&2
exit 1
fi

npm version "$bump_type" --no-git-tag-version >/dev/null

new_version="$(node -p "require('./package.json').version")"

if [[ -z "$new_version" ]]; then
echo "Unable to determine updated version from package.json" >&2
exit 1
fi

perl -0pi -e "s/^(Stable tag:\s+).*
/\${1}$new_version\n/m" readme.txt

perl -0pi -e "s/^(== Changelog ==\r?\n\r?\n)/\${1}= $new_version - TBD =\n\n/m" readme.txt

readme_tmp="$(mktemp)"
awk '
BEGIN {
in_changelog = 0
release_count = 0
skipping_old = 0
}
/^== Changelog ==\r?$/ {
in_changelog = 1
print
next
}
in_changelog && /^\[View historical changelog details here\]/ {
skipping_old = 0
in_changelog = 0
print
next
}
in_changelog {
if ( $0 ~ /^= [0-9]+\.[0-9]+\.[0-9]+( - .*)? =\r?$/ ) {
release_count++
if ( release_count > 4 ) {
skipping_old = 1
next
}
skipping_old = 0
}
if ( skipping_old ) {
next
}
}
{
print
}
' readme.txt > "$readme_tmp"
mv "$readme_tmp" readme.txt

perl -0pi -e "s/^(\s*\* Version:\s+).*
/\${1}$new_version\n/m" simple-podcasting.php

perl -0pi -e "s/^(define\( 'PODCASTING_VERSION', ')([^']+)('\s*\);)
/\${1}$new_version\${3}\n/m" simple-podcasting.php

perl -0pi -e "s/^(## \[Unreleased\].*\n\n)/\${1}## [$new_version] - TBD\n\n/m" CHANGELOG.md

perl -0pi -e "s#^(\[Unreleased\]: .*\n)#\${1}[$new_version]: https://github.com/10up/simple-podcasting/compare/$current_version...$new_version\n#m" CHANGELOG.md

echo "Bumped version to $new_version"
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@10up/simple-podcasting",
"version": "1.9.1",
"version": "2.0.0",
"description": "A simple podcasting solution for WordPress. ",
"homepage": "https://github.com/10up/simple-podcasting",
"bugs": {
Expand Down
Loading
Loading