Russell
Russell

Reputation: 496

Publish a composer package with GitLab CI using a non-standard project layout

Project structure:

We have all our repos setup in a way where if you need to work on a project, you can clone it, run docker-compose up, start our proxy container, and get to work. The first problem comes from the way GitLab's registry publishes composer packages, which requires a composer.json at the repository root.

My first idea was to create a release branch, in CI I would then checkout the release branch to a temporary folder, copy everything from the package folder, then commit to release. That exposed the second problem, semantic-release uses commit history to tag release versions. Since the branches don't have the same commit history all our feat/fix commit messages were lost.

My next idea was to merge main onto release, commit changes. Rearrange the files so they match the desired package structure, then commit. This worked for a single release, the next was hit with CONFLICT (modify/delete) git merge errors.



At this point, I think there's a simpler solution than what I'm trying to do and I'm too in the weeds to see it, or my knowledge of git is insufficient to realize it.

Any suggestions for what to try from here would be appreciated.

Upvotes: 0

Views: 28

Answers (0)

Related Questions