Releasing a new version of Shopsys Framework
For releasing a new version of Shopsys Framework, we are leveraging release
command from symplify/monorepo-builder package.
All the source codes and configuration of our release process can be found in utils/releaser
folder that is located in the root of the monorepo.
Each step of the release process is defined as an implementation of Symplify\MonorepoBuilder\Release\Contract\ReleaseWorker\ReleaseWorkerInterface
,
therefore we refer to the step definitions as to "release workers".
Stages¶
The whole release process is divided into 3 stages that are run separately:
release-candidate
- steps that are done before the release candidate branch is sent to code review and testing
- the release workers are defined in
src/ReleaseWorker/ReleaseCandidate
folder
release
- steps that are done during the actual release
- the release workers are defined in
src/ReleaseWorker/Release
folder
after-release
- steps that are done after the release
- the release workers are defined in
src/ReleaseWorker/AfterRelease
folder
Release command¶
Caution
Before you start releasing, you need to mount your .gitconfig
to php-fpm
docker container to be able to perform automated commits within the container.
Add following line into your docker-compose.yml
in services -> php-fpm -> volumes
path:
- ~/.gitconfig:/home/www-data/.gitconfig
To perform a desired stage, run the following command in the php-fpm
docker container and follow instructions that you'll be asked in console.
vendor/bin/monorepo-builder release <release-number> --stage <stage> -v
If you want only to display a particular stage, along with the release worker class names, add the --dry-run
argument:
vendor/bin/monorepo-builder release <release-number> --dry-run --stage <stage> -v
Notes¶
- The "release-number" argument is the desired tag you want to release, it should always follow the semantic versioning
and start with the "v" prefix, e.g.
v7.0.0
. - The releaser needs
.git
folder available - this is a problem currently for our Docker on Mac and Windows configuration as the folder is currently ignored for performance reasons. There is an issue on Github that mentions the problem. However, there is a workaround - you can add newdocker-sync
volume just for git. - Releasing a stage is a continuously running process so do not exit your CLI if it is not necessary.