Skip to content

Commit aff61fd

Browse files
committed
github workflow added, version 1.0.9 released
1 parent 2c1c204 commit aff61fd

File tree

7 files changed

+131
-53
lines changed

7 files changed

+131
-53
lines changed

.distignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/.wordpress-org
2+
/.git
3+
/.github
4+
/node_modules
5+
6+
.distignore
7+
.gitignore
8+
.gitattributes

.gitattributes

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Directories
2+
/.wordpress-org export-ignore
3+
/.github export-ignore
4+
5+
# Files
6+
/.gitattributes export-ignore
7+
/.gitignore export-ignore

.github/workflows/deploy.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: Deploy to GitHub
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
jobs:
9+
tag:
10+
name: Deploy Plugin Tag
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Debug File List
17+
run: ls -R
18+
19+
- name: Install SVN (Subversion)
20+
run: |
21+
sudo apt-get update
22+
sudo apt-get install subversion
23+
24+
- name: Find Readme File
25+
id: find_readme
26+
run: |
27+
readme_file=$(find . -type f -iname "readme.*" | head -n 1)
28+
if [ -n "$readme_file" ]; then
29+
echo "Readme file found: $readme_file"
30+
echo "readme_file=$readme_file" >> $GITHUB_ENV
31+
else
32+
echo "::error::Readme file not found."
33+
exit 1
34+
fi
35+
36+
- name: Extract Release Notes
37+
id: release_notes
38+
run: |
39+
# Define variables
40+
changelog_section_start="== Changelog =="
41+
current_tag="${{ github.ref_name }}"
42+
readme_file="${{ env.readme_file }}"
43+
44+
# Extract version from tag (strip 'refs/tags/' if it exists)
45+
version=${current_tag#refs/tags/}
46+
47+
# Initialize variables
48+
in_changelog=0
49+
capturing_version=0
50+
release_notes=""
51+
52+
while IFS= read -r line; do
53+
# Start capturing after finding the changelog section
54+
if [[ "$line" == "$changelog_section_start" ]]; then
55+
in_changelog=1
56+
continue
57+
fi
58+
59+
# Skip lines before the changelog section
60+
if [[ $in_changelog -eq 0 ]]; then
61+
continue
62+
fi
63+
64+
# Start capturing if the line matches the current version
65+
if [[ "$line" == "= $version =" ]]; then
66+
capturing_version=1
67+
release_notes+="$line\n"
68+
continue
69+
fi
70+
71+
# Stop capturing when a new version is detected
72+
if [[ $capturing_version -eq 1 && "$line" =~ ^= ]]; then
73+
break
74+
fi
75+
76+
# Add the line to the release notes if we are capturing
77+
if [[ $capturing_version -eq 1 ]]; then
78+
release_notes+="$line\n"
79+
fi
80+
done < "$readme_file"
81+
82+
# Check if release notes were extracted
83+
if [[ -z "$release_notes" ]]; then
84+
echo "::error::Failed to extract release notes for version $version."
85+
exit 1
86+
fi
87+
88+
# Debug: Print extracted release notes
89+
echo "Extracted release notes for version $version:"
90+
printf "%b" "$release_notes"
91+
92+
# Set output for release notes
93+
echo "::set-output name=notes::$(printf "%b" "$release_notes")"
94+
95+
- name: Debug Release Notes
96+
run: |
97+
echo "Debugging Release Notes:"
98+
echo "${{ steps.release_notes.outputs.notes }}"
99+
100+
- name: Create GitHub Release
101+
uses: softprops/action-gh-release@v2
102+
with:
103+
tag_name: ${{ github.ref_name }}
104+
body: ${{ steps.release_notes.outputs.notes }}
105+
files: ${{github.workspace}}/${{ github.event.repository.name }}.zip
106+
107+
env:
108+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Whitespace-only changes.

README.md

Lines changed: 0 additions & 47 deletions
This file was deleted.

README.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Contributors: codeboxr, manchumahara
33
Requires at least: 5.3
44
Tested up to: 6.7.1
5-
Stable tag: 1.0.8
5+
Stable tag: 1.0.9
66
License: MIT
77
License URI: https://github.com/codeboxrcodehub/cbxphpspreadsheet/blob/master/LICENSE.txt
88

@@ -20,7 +20,7 @@ Software requirements
2020

2121
The following software is required to develop using PhpSpreadsheet:
2222

23-
* PHP version 7.4 or newer
23+
* PHP version 8.1 or newer
2424
* PHP extension php_zip enabled
2525
* PHP extension php_xml enabled
2626
* PHP extension php_gd2 enabled (if not compiled in)
@@ -52,6 +52,9 @@ if ( defined('CBXPHPSPREADSHEET_PLUGIN_NAME') && cbxphpspreadsheet_loadable() )
5252

5353

5454
== Changelog ==
55+
= 1.0.9 =
56+
* Fixed function 'php_version_check'
57+
5558
= 1.0.8 =
5659
* Dependency vendor packages updated to latest
5760
* Added some helper functions for better environment checking

cbxphpspreadsheet.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* Plugin Name: CBX PhpSpreadSheet Library
1717
* Plugin URI: https://codeboxr.com/php-spreadsheet-library-wordpress-plugin/
1818
* Description: A pure PHP library for reading and writing spreadsheet files https://phpspreadsheet.readthedocs.io/
19-
* Version: 1.0.8
19+
* Version: 1.0.9
2020
* Requires PHP: 8.1.99
2121
* Author: Codeboxr
2222
* Author URI: https://github.com/PHPOffice/PhpSpreadsheet
@@ -33,7 +33,7 @@
3333
}
3434

3535
defined( 'CBXPHPSPREADSHEET_PLUGIN_NAME' ) or define( 'CBXPHPSPREADSHEET_PLUGIN_NAME', 'cbxphpspreadsheet' );
36-
defined( 'CBXPHPSPREADSHEET_PLUGIN_VERSION' ) or define( 'CBXPHPSPREADSHEET_PLUGIN_VERSION', '1.0.8' );
36+
defined( 'CBXPHPSPREADSHEET_PLUGIN_VERSION' ) or define( 'CBXPHPSPREADSHEET_PLUGIN_VERSION', '1.0.9' );
3737
defined( 'CBXPHPSPREADSHEET_BASE_NAME' ) or define( 'CBXPHPSPREADSHEET_BASE_NAME', plugin_basename( __FILE__ ) );
3838
defined( 'CBXPHPSPREADSHEET_ROOT_PATH' ) or define( 'CBXPHPSPREADSHEET_ROOT_PATH', plugin_dir_path( __FILE__ ) );
3939
defined( 'CBXPHPSPREADSHEET_ROOT_URL' ) or define( 'CBXPHPSPREADSHEET_ROOT_URL', plugin_dir_url( __FILE__ ) );
@@ -109,8 +109,7 @@ public function activation_error_display() {
109109
* @return bool
110110
*/
111111
private static function php_version_check() {
112-
//return version_compare( PHP_VERSION, '8.1.99', '>=' );
113-
return false;
112+
return version_compare( PHP_VERSION, '8.1.99', '>=' );
114113
}//end method php_version_check
115114

116115
/**

0 commit comments

Comments
 (0)