Skip to content

Commit

Permalink
Merge pull request #225 from /issues/223
Browse files Browse the repository at this point in the history
bash script for doing release checklist, resolves #223
  • Loading branch information
MichelleBlanchette authored May 4, 2024
2 parents 2c2e4f9 + bd365b0 commit 67b47d0
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 9 deletions.
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### [unreleased]
### 4.3.0 - 2024-05-04

#### Added

Expand Down
41 changes: 41 additions & 0 deletions prepare_release.sh
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
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: michelleblanchette
Tags: asana, project, task, management, manager, integration, api, work, business, collaboration, client, customer, support, portal, dashboard, widget, metabox, shortcodes
Requires at least: 5.0.0
Tested up to: 6.5.2
Stable tag: 4.2.1
Stable tag: 4.3.0
Requires PHP: 7.2
License: GPL-3.0-or-later
License URI: https://www.gnu.org/licenses/gpl-3.0.txt
Expand Down
2 changes: 1 addition & 1 deletion src/components/task/TaskSingleAsync.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* TaskSingleAsync component
*
* @since [unreleased]
* @since 4.3.0
*/

import TaskListItem from './TaskListItem.jsx';
Expand Down
2 changes: 1 addition & 1 deletion src/includes/class-asana-interface.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,7 @@ function ( $err ) {
* Attempts to retrieve task data. Providing the post id of the provided
* pinned task gid will also attempt data self-healing.
*
* @since [unreleased] Revived $opt_fields param.
* @since 4.3.0 Revived $opt_fields param.
* @since 3.1.0 Marked $opt_fields param as deprecated.
* @since 1.0.0
*
Expand Down
2 changes: 1 addition & 1 deletion src/includes/class-html-builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ public static function get_local_attachment_view_url(
*
* @see PTC_Completionist\REST_API\Attachments::handle_get_attachment()
*
* @since [unreleased]
* @since 4.3.0
*
* @param string $attachment_gid The Asana attachment's GID.
* @param array $args Optional. Additional arguments for the
Expand Down
4 changes: 2 additions & 2 deletions src/index_ShortcodeAsanaTask.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Renders the [ptc_asana_task] shortcode.
*
* @since [unreleased]
* @since 4.3.0
*/

import TaskSingleAsync from './components/task/TaskSingleAsync.jsx';
Expand All @@ -21,7 +21,7 @@ document.addEventListener('DOMContentLoaded', () => {
* Filters the element to be rendered for displaying the
* [ptc_asana_task] shortcode.
*
* @since [unreleased]
* @since 4.3.0
*
* @param {Object} element - The element to render.
* Default <TaskSingleAsync />.
Expand Down
2 changes: 1 addition & 1 deletion src/public/class-shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ public static function get_ptc_asana_project(
/**
* Gets the [ptc_asana_task] shortcode content.
*
* @since [unreleased]
* @since 4.3.0
*
* @see \add_shortcode()
*
Expand Down
2 changes: 1 addition & 1 deletion src/public/rest-api/class-tasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public static function handle_create_task(
/**
* Handles a GET request to retrieve Asana task data.
*
* @since [unreleased]
* @since 4.3.0
*
* @param \WP_REST_Request $request The API request.
*
Expand Down

0 comments on commit 67b47d0

Please sign in to comment.