Skip to content

Commit

Permalink
Version increased to 1.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
bishwajitcadhikary committed Jan 24, 2024
1 parent 93ede4b commit 7d44231
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

- name: Compression
run: |
zip -r spromoter-social-reviews-for-woocommerce.zip . -x ".*"
zip -r spromoter-social-reviews-for-woocommerce.zip . -x ".*" -x "build.sh"
- name: Create Release
id: create_release
Expand Down
25 changes: 25 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# Define the path to your PHP file
php_file="spromoter.php"

# Extract the current version from the PHP file
current_version=$(grep -oP "Version: \K[0-9.]+" "$php_file")

# Increase the version number (assuming a standard version format like x.y.z)
new_version=$(echo "$current_version" | awk -F. '{print $1"."$2"."$3 + 1}')

# Update the version in the PHP file
sed -i "s/Version: $current_version/Version: $new_version/" "$php_file"

# Display the updated version
echo "Version increased to $new_version"

echo "Commiting changes to git & pushing to remote"
git add .
git commit -m "Version increased to $new_version"
git push origin main

echo "Creating a new tag"
git tag -a "$new_version" -m "Version $new_version"
git push origin "$new_version"
13 changes: 10 additions & 3 deletions includes/plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class Plugin
*
* @var string
*/
public $version = '1.0.6';
public $version;

/**
* Main Plugin Instance.
Expand All @@ -46,7 +46,7 @@ public static function instance(): Plugin
*/
public function __clone()
{
_doing_it_wrong(__FUNCTION__, __('Foul!', 'spromoter-social-reviews-for-woocommerce'), '1.0.0');
_doing_it_wrong(__FUNCTION__, __('Foul!', 'spromoter-social-reviews-for-woocommerce'), $this->version);
}

/**
Expand All @@ -56,7 +56,7 @@ public function __clone()
*/
public function __wakeup()
{
_doing_it_wrong(__FUNCTION__, __('Foul!', 'spromoter-social-reviews-for-woocommerce'), '1.0.0');
_doing_it_wrong(__FUNCTION__, __('Foul!', 'spromoter-social-reviews-for-woocommerce'), $this->version);
}

/**
Expand All @@ -65,6 +65,7 @@ public function __wakeup()
*/
public function __construct()
{
$this->setPluginVersion();
$this->define_constants();
$this->includes();
$this->init();
Expand Down Expand Up @@ -92,6 +93,12 @@ public function plugin_path(): string
return untrailingslashit( plugin_dir_path( dirname( __FILE__ ) ) );
}

public function setPluginVersion()
{
$plugin_data = get_file_data( SP_PLUGIN_FILE, array( 'Version' => 'Version' ) );
$this->version = $plugin_data['Version'];
}

/**
* Plugin base name
*
Expand Down
2 changes: 1 addition & 1 deletion spromoter.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: SPromoter Social Reviews for WooCommerce
* Plugin URI: https://reviews.spromoter.com/integrations/woocommerce
* Description: SPromoter Social Reviews for WooCommerce helps you to collect and display reviews from your customers on your WooCommerce store.
* Version: 1.0.6
* Version: 1.0.9
* Requires at least: 5.2
* Requires PHP: 7.2
* Author: SPromoter
Expand Down

0 comments on commit 7d44231

Please sign in to comment.