Skip to content

Versioning Plugins for the WordPress Upstream

James Reidy edited this page Mar 20, 2020 · 4 revisions

We build the upstreams for the Pantheon WordPress sites using Composer, and Composer can recognize certain tags in the GitHub repo. This works well when you use Semantic Versioning.

As you work on WordPress plugins in GitHub for the Unit Web Site, please create a tag for each release you want added to the upstream - something like v1.4.2 .

You can create this tag however in your current git workflow.

I've been using SourceTree for managing git repositories. SourceTree has a GitFlow feature which makes it easy to work with git, and easy to tag releases with version numbers that Composer can recognize. I've been using master and develop as the main branches, and /feature/[feature_name] for features I'm working on, and /release/[release tag, e.g. v1.4.2] for releases. (This is the default setup provided by GitFlow.)

When you start, you have just a master branch. Then you click on 'Git Flow' and it will create a develop branch from the master branch. Then you click on Git Flow > Start a New Feature and give it a name - 'my_feature'. This will create a branch based on develop called feature/my_feature. You do your work here, then click on Git Flow > Finish Current. This will merge feature/my_feature into develop. If you want to release the current state of develop, click on Git Flow > Start a New Release and give it your new version number, like v1.4.2. This will make a branch release/v1.4.2 from develop. Then you click Git Flow > Finish Current, and it will merge release/v1.4.2 into the master branch, and give it the tag v1.4.2 that Composer can use for the upstream. Finally, it will merge the master branch into develop, and check out develop, so you can work on the next feature.