Skip to content

Commit

Permalink
Add Local Build Script, Update README and CHANGELOG
Browse files Browse the repository at this point in the history
### Added
- New local build script for creating a zip of the project.
- Instructions in README for handling placeholder strings and potential permission errors.

### Changed
- Updated CHANGELOG to include the addition of the new build script.
  • Loading branch information
smileBeda committed May 29, 2024
1 parent 02c88b1 commit f61d092
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 17 deletions.
16 changes: 1 addition & 15 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,14 @@ All notable changes to _this project_ will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 2024-05-29
- [Added]: New paths in the release workflow file
- [Added]: Additional properties and methods to Base_Metabox class for better flexibility
- [Changed]: Updated minimum PHP version requirement to 8.0.0
- [Changed]: Updated minimum WordPress version requirement to 4.0
- [Changed]: Refactored how metaboxes are registered and saved, improving code clarity
- [Changed]: Renamed keys for shortcodes, taxonomies, and custom post types using a configurable slug
- [Changed]: Replaced specific metabox class with a more generic example
- [Fixed]: Incorrect author information in several files
- [Removed]: Unused function imports across multiple files

## ## 2024-05-26
- [Fixed] Properly initialise WP_Filesystem
- [Fixed] Use HTML file extension for resouurce files

This is NOT the changelog of the WordPress Plugin you ultimately develop!

## [v5-alpha] - 2024-05-29

### Added
- New paths in the release workflow file.
- Additional properties and methods to Base_Metabox class for better flexibility.
- New .sh script to build local release.

### Changed
- Updated minimum PHP version requirement to 8.0.0.
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ For detailed documentation on the Plugin usage and Development processes, please
_Until Wiki is online_
- to manage and release a plugin with this repo/clone of
- clone/fork this entire repo. Make sure to give the repo the exact name you will want for your _plugin_ (such as `my-awesome-plugin`). The release workflows will use that to zip up your built releases.
- src/replace all strings that are placeholders
- your _plugin_ will be whatever is inside the root `src` folder. The rest of the root content is NOT part of your plugin, but part of your dev env and workflow
- develop your plugin by making changes to anything inside the root `src` folder
- if you need other dependencies add them to the composer file, remove composer lock, and run `composer install`
Expand All @@ -50,10 +51,12 @@ _Until Wiki is online_

==> IF you run autoloader manually locally to maybe test your plugin, keep in mind to search-replace the `/src/src/` > `/src/` in the `/src/vendor/composer` files to guarantee no errors. _This step is done for you if you use the release workflow_.


Of course, if this is all too much for you, feel free to just extract `src` contents and use that as your repo, this is entirely up to you.

==> `/bin` includes other helpful scripts to generate documentation of your _plugin_ as well as convert documents from a to another format
==> `/bin` includes other helpful scripts to generate documentation of your _plugin_ as well as convert documents from a to another format or build a local copy of the plugin (useful for testing ;)

==> If running into 403 errors when releasing, make sure workflows have write permission on your repo
==> if you .sh files return a permission error, run `chmod +x {FILE}.sh`

# Credits

Expand Down
30 changes: 30 additions & 0 deletions bin/local_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# Navigate to the parent directory to ensure we are at the project root
cd ..

# Get the name of the current directory (which should be the repository name)
REPO_NAME=$(basename "$(pwd)")

# Install dependencies and dump autoload
composer install --no-dev --optimize-autoloader

# Make replacements in composer autoload files
sed -i '' 's|src/src|src|g' src/vendor/composer/autoload_classmap.php
sed -i '' 's|src/src|src|g' src/vendor/composer/autoload_static.php
sed -i '' 's|\.\./\.\./\.\.|../..|g' src/vendor/composer/autoload_static.php

# Prompt for output directory
read -p "Enter the output directory for the built zip: " OUTPUT_DIR
mkdir -p "../$OUTPUT_DIR" # Create the directory if it does not exist

# Create the zip
cd src # Change to src directory to zip its contents
zip -r "$OUTPUT_DIR/$REPO_NAME.zip" ./* # Zip all contents of src directly
cd .. # Go back to the root directory

# Confirmation of build
echo "Build complete. Zip file located at: $OUTPUT_DIR/$REPO_NAME.zip"

# Navigate back to the bin directory to maintain the initial script execution state
cd bin

0 comments on commit f61d092

Please sign in to comment.