Skip to content

display proper version in phar#264

Open
mglaman wants to merge 1 commit intomainfrom
phar-version
Open

display proper version in phar#264
mglaman wants to merge 1 commit intomainfrom
phar-version

Conversation

@mglaman
Copy link
Owner

@mglaman mglaman commented Feb 19, 2026

fixes #63

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes incorrect --version output (Issue #63) by ensuring the CLI reports the release tag when built as a PHAR, while still reporting the Composer-installed package version when installed via Composer.

Changes:

  • Use a Box-replaced @package_version@ placeholder for PHAR builds, with a Composer InstalledVersions fallback for non-PHAR installs.
  • Configure Box to inject the git-derived version into the build.
  • Update the release workflow checkout to fetch full git history (required for tag-based versioning).

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
src/Cli/Application.php Uses a build-time placeholder for PHAR versioning with a Composer fallback.
box.json Configures Box to provide a git-derived version for placeholder replacement.
.github/workflows/release.yml Ensures tags/history are available during release builds by using fetch-depth: 0.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -1,4 +1,5 @@
{
"git-version": "@package_version@",
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--version option does not report the correct version number

2 participants