1

We have git repositories that are Composer, php packages.

To publish a new version of one of these Composer packages on https://packagist.org we currently do the following:

  1. Create a new git tag such as v1.0.0 and push it.
  2. Travis-CI picks up this change and runs our tests.
  3. Packagist (composer) also picks the new tag and auto-magically publishes a new version v1.0.0

The issues we have with this workflow is:

  • If the tests fail, there a broken version of our package is published.
  • A PR workflow would alleviate this, although not totally.
  • Most package mangers such as NPM; have release/publish functionality.

Creating a PR and only merging into master on passing builds is great. Although it still allows maintainers to release versions from master that do not pass CI, if they forego the PR workflow.

AndrewMcLagan
  • 13,459
  • 23
  • 91
  • 158
  • 1
    Could you describe your process for making changes? Especially open source projects it is common to create a Pull Request (PR) against a stable master-branch, that is then checked via Travis. Merging the PR is only allowed when it passes. You can also run Travis for each merge into a specific branch like master. This way you would know before tagging the release, whether the build is stable. In any case, knowing more about your process could help giving a more specific, helpful answer. – dbrumann Jun 06 '19 at 05:13
  • 1
    I agree with @dbrumann - instead of trying to fix the problem, avoid it. The common practice is to tag a release only when it is ready, meaning after it has passed tests. So the flow is normally: Create a PR, let it pass tests, merge to master, tag, push and release. – DannyB Jun 06 '19 at 05:24
  • Sure. We have currently been avoiding a PR workflow as our packages (bar a few) require fast development in the first few months, then after that they would move into a PR workflow and as you both describe; This would alleviate the issues... I have updated the Question with more detail. – AndrewMcLagan Jun 07 '19 at 02:28

0 Answers0