VOOZH about

URL: https://deepwiki.com/guanguans/ai-commit/6.4-build-and-release-process

⇱ Build and Release Process | guanguans/ai-commit | DeepWiki


Loading...
Menu

Build and Release Process

This page covers how the ai-commit PHAR artifact is built, how versions are tagged and released, and how CHANGELOG.md is maintained. It focuses on the build tooling (box.json), the release automation (monorepo-builder.php), and the GitHub Actions workflows that coordinate publication.

For information about the CI quality gates that run on every push (tests, linting, static analysis), see CI/CD Workflows. For the development environment setup needed before running these tools locally, see Development Environment Setup.


Overview

Release pipeline diagram


Sources: monorepo-builder.php41-54 .github/workflows/publish-phar.yml1-61 .github/workflows/update-changelog.yml1-30


PHAR Build Configuration

The PHAR is produced by Humbug Box controlled by box.json at the repository root. Laravel Zero's app:build console command invokes Box internally.

box.json Settings

FieldValueEffect
chmod"0755"Makes the output PHAR directly executable
directoriesapp, bootstrap, config, resources/lang, vendorDirectories bundled into the PHAR
filescomposer.jsonIndividual files added to the PHAR
exclude-composer-filesfalseKeeps Composer metadata inside the PHAR
exclude-dev-filesfalseDoes not strip dev-only files
compression"GZ"Applies GZip compression to the PHAR contents
compactorsPhp, JsonStrips whitespace/comments from PHP and JSON files

Sources: box.json1-21

Build command

./ai-commit app:build ai-commit.phar --build-version=<version>

The app:build command is provided by Laravel Zero. It calls Box with box.json as configuration and writes output to builds/ai-commit.phar.

The header of the committed builds/ai-commit confirms the toolchain:

Generated by Humbug Box 3.16.0@adb282a.

Sources: builds/ai-commit1-8 .github/workflows/publish-phar.yml37-38

What is builds/ai-commit?

builds/ai-commit is the PHAR without the .phar extension, committed directly to the main branch. It is the file users download or execute directly via ./builds/ai-commit. It is binary (GZ-compressed PHAR format) and tracked in version control.

After the CI build, the workflow copies builds/ai-commit.pharbuilds/ai-commit and commits it:

cp builds/ai-commit.phar builds/ai-commit

Sources: .github/workflows/publish-phar.yml52-60 builds/ai-commit1-16


Release Worker Sequence

Releases are driven by symplify/monorepo-builder The release workers are registered in monorepo-builder.php and execute in order.

Release worker execution order


Sources: monorepo-builder.php41-54

Active workers

Worker classRole
TagVersionReleaseWorkerCreates a local git tag for the release version
PushTagReleaseWorkerPushes the tag to the remote repository
UpdateChangelogViaGoReleaseWorkerUpdates CHANGELOG.md using git-chglog (Go-based tool)
CreateGithubReleaseReleaseWorkerCreates a GitHub Release via the GitHub API

Workers listed as commented-out in monorepo-builder.php are disabled:

Disabled workerWhy disabled
UpdateReplaceReleaseWorkerNot a monorepo with split packages
SetCurrentMutualDependenciesReleaseWorkerSingle-package repo
AddTagToChangelogReleaseWorkerReplaced by UpdateChangelogViaGoReleaseWorker
UpdateChangelogViaNodeReleaseWorkerAlternative; Go tool is used instead
UpdateChangelogViaPhpReleaseWorkerAlternative; Go tool is used instead
SetNextMutualDependenciesReleaseWorkerSingle-package repo
UpdateBranchAliasReleaseWorkerNot configured
PushNextDevReleaseWorkerNot used

Sources: monorepo-builder.php41-54


CHANGELOG.md Maintenance

The changelog is managed by two mechanisms that operate at different points in the release process.

1. git-chglog (Go tool) via UpdateChangelogViaGoReleaseWorker

Configuration lives in .chglog/config.yml. The tool reads conventional commit messages and generates CHANGELOG.md using the template at .chglog/CHANGELOG.tpl.md.

Commit type filtering and grouping

Commit typeGroup title in CHANGELOG
feat✨ Features
fix🐞 Bug Fixes
docs📖 Documents
style🎨 Styles
refactor💅 Code Refactorings
perf🏎 Performance Improvements
test✅ Tests
build📦 Builds
ci🤖 Continuous Integrations
revert⏪️ Reverts

The chore type is explicitly filtered out (commented in config).

Commit header pattern (from .chglog/config.yml):

^(\w*)(?:\(([\w\$\.\-\*\s]*)\))?:\s(.*)$

Maps to: Type, Scope, Subject.

Sources: .chglog/config.yml1-77 .chglog/CHANGELOG.tpl.md1-63

2. update-changelog.yml workflow

This workflow triggers on release: types: [released] (after a release is published on GitHub). It uses stefanzweifel/changelog-updater-action@v1 to inject the release notes from the GitHub Release body into CHANGELOG.md, then commits the result back to main.


Sources: .github/workflows/update-changelog.yml1-30


publish-phar.yml Workflow Detail

Trigger: release: types: [created]

Runner: ubuntu-22.04

PHP version: 8.2

Step-by-step


Tag extraction: The workflow extracts the version number from GITHUB_REF by stripping the leading v prefix:


This tag is passed to --build-version so the PHAR reports the correct version at runtime.

Sources: .github/workflows/publish-phar.yml1-61


Artifact Locations

ArtifactPathNotes
PHAR with extensionbuilds/ai-commit.pharBuilt during workflow, uploaded to GitHub Release
PHAR without extensionbuilds/ai-commitCommitted to main; used for self-invocation and direct download
ChangelogCHANGELOG.mdUpdated by both git-chglog and the update-changelog workflow

Sources: .github/workflows/publish-phar.yml43-60 builds/ai-commit1-8


File Map


Sources: box.json1-21 monorepo-builder.php1-57 .chglog/config.yml1-77 .github/workflows/publish-phar.yml1-61 .github/workflows/update-changelog.yml1-30