cedrickring / golang-action

A GitHub Action to run Go commands
Apache License 2.0
134 stars 33 forks source link

Suggestion for semver tag and release convention to use `v1.1.1` #14

Open dougnukem opened 5 years ago

dougnukem commented 5 years ago

This is a minor nitpick but with semantic versioning in an SCM like git the standard advice says to name it v${major}.${minor}.${patch}

Ideally we could name the github releases and tag are:

In terms of release branches I think its fine to call it something like: releases/v1.1

You also could do a 'just-in-time' release branch model where the tag is done on master and only when you need to specifically hotfix do you create the release branch:

# need to hotfix release `v1.2.0`
$ git checkout tags/v1.2 -b releases/1.2
# cherry-pick some merge commit
$ git cherry-pick -m 1 xyzabc
# Update Docker label version etc
$ make version-bump-patch 
$ git commit -a -m "Update version to 1.2.1"
$ git tag v1.2.1

For docker image tags I think the convention for semver is to have the following combinations of tags:

I think the ideal situation is users depend on a specific major version e.g. cedrickrin/golang-action:2 and get the benefit of passively upgrading for bug/security fixes in any minor/patch versions while depending on the major version not having any backwards incompatible changes.

cedrickring commented 5 years ago

So we keep the major.minor.patch versioning for Docker?

You also could do a 'just-in-time' release branch model where the tag is done on master and only when you need to specifically hotfix do you create the release branch:

Does GitHub support overwriting tags? So the Docker versioning could apply to GH aswell. You could specify only e.g. v2 in your main.workflow and get all the latest minors and patches too.

This maybe relates to this issue aswell: Can we add some script to automatically update the README.md when a new release happens? Something like: replace all vx.x.x with the latest version.

dougnukem commented 5 years ago

Yes you can overwrite the git tags to match that versioning scheme, but I think the best process is to treat tags as immutable, and just re-tag the same ones as vX.Y.Z

I think it'd could make sense to use the docker versioning scheme and force tags for minor/patch updates:

dougnukem commented 5 years ago

Also i think while it's in master the process should be that things are tagged/re-tagged as: v1.2.0-develop - indicating the "next" version that will be released

We can add that to the Makefile process and update Readme and Dockerfile accordingly.