This document describes how to create a new release of hell2shape.
The project uses GitHub Actions with manual workflow dispatch to manage version numbers. This gives you full control over when releases are created.
# Make sure all changes are committed and pushed
git status
git push origin main
# Run tests to ensure everything works
vendor/bin/phpunit
# Run static analysis
vendor/bin/phpstan analyse
# Check code style
vendor/bin/ecs check- Go to your repository on GitHub
- Click on the "Actions" tab
- Select "Create Version Tag" workflow from the left sidebar
- Click "Run workflow" button (top right)
- Fill in the required field:
- Version number: Enter the version (e.g.,
0.2.0- without thevprefix)
- Version number: Enter the version (e.g.,
- Click "Run workflow" to start
The workflow (.github/workflows/release.yml) will automatically:
- Generate
src/Version.phpwith the specified version and current date - Commit the file to the main branch with message "Release vX.Y.Z"
- Create and push a git tag
vX.Y.Z
After the workflow completes:
- Go to your repository on GitHub
- Click on "Releases" in the right sidebar (or go to
/releases) - Click "Draft a new release"
- Select the tag that was just created (e.g.,
v0.2.0) - Add a release title (e.g., "Version 0.2.0")
- Write release notes describing:
- New features
- Bug fixes
- Breaking changes
- Any other relevant information
- Click "Publish release"
- New phar file should be compiled and added into assets. Thanks to Build Release PHAR workflow.
This creates a formal release on GitHub with your detailed release notes, making it easier for users to understand what changed. A new PHAR file asset can be used in related projects.
If you've set up the Packagist webhook (recommended), the new version will be available on Packagist within minutes.
If not, you can manually trigger an update on your package's Packagist page.
Follow Semantic Versioning:
- MAJOR version (1.0.0): Incompatible API changes
- MINOR version (0.2.0): New functionality, backwards compatible
- PATCH version (0.1.1): Bug fixes, backwards compatible
The src/Version.php file is automatically generated and should not be edited manually. It contains:
final class Version
{
public const VERSION = '0.2.0';
public const RELEASE_DATE = '2025-12-31';
}This file is used by the CLI application to display the version number:
bin/hell2shape --version
# Output: hell2shape 0.2.0If the GitHub Actions workflow fails:
- Check the workflow logs in the "Actions" tab on GitHub
- Ensure you have the correct permissions set in the workflow file
- Verify you entered the version number correctly (without
vprefix) - Make sure the main branch is up to date
If the version doesn't update after running the workflow:
- Check that the workflow ran successfully in the Actions tab
- Pull the latest changes:
git pull origin main - Verify
src/Version.phpwas updated - Check that the git tag was created:
git fetch --tags && git tag -l
If Packagist doesn't show the new version:
- Check if the webhook is configured correctly
- Manually trigger an update on Packagist
- Wait a few minutes - updates can take time