Add support for multiple semver tags#10
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10 +/- ##
==========================================
+ Coverage 71.21% 72.36% +1.15%
==========================================
Files 3 3
Lines 66 76 +10
Branches 14 16 +2
==========================================
+ Hits 47 55 +8
Misses 6 6
- Partials 13 15 +2
Continue to review full report at Codecov.
|
| 'ghcr.io/user/app:v2', | ||
| 'ghcr.io/user/app:v2.0', | ||
| 'ghcr.io/user/app:v2.0.8', |
There was a problem hiding this comment.
v2, v2.0 and v2.0.8 tags should not be generated for pre-release. As explained in semver specification prerelease versions are updated frequently, and contain many breaking changes that are (by the author's design) not yet fit for public consumption.
| sepLabels: core.getInput('sep-labels') || `\n`, | ||
| githubToken: core.getInput('github-token') | ||
| githubToken: core.getInput('github-token'), | ||
| fullSemver: /true/i.test(core.getInput('full-semver') || 'false'), |
There was a problem hiding this comment.
| fullSemver: /true/i.test(core.getInput('full-semver') || 'false'), | |
| fullSemver: /true/i.test(core.getInput('full-semver')), |
|
And also update the relevant documentation. |
|
@fastlorenzo I thought a little bit more about the implementation and I think we should go through templating instead. I had been working on this via #3 and I think I'll put it back for your use case. The idea will be to improve this feature by using a list of versions that you want to assign as tags: -
name: Docker meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: name/app
tag-semver: |
v{{major}}
v{{major}}.{{minor}}
v{{major}}.{{minor}}.{{patch}} |
|
Looks good to me as well, but what does it do when ref is not a valid semver (for example, using the same action to build container for a tag or for a push in a branch)? |
|
@fastlorenzo Will do nothing if it's not a valid semver. |
ok then I guess we can close this PR and go with your solution using |
This PR relates to issue #6
If
full-semverinput is set to true, the action will try to parse the version tag (usingsemverpackage) and extract themajor,minor,patchandprereleasecomponents.Example for input tag
v1.2.3-beta.4, the following tags will be added:v1v1.2v1.2.3Note that to add the prefix (
vin this case), the following input option has been added as well:semver-prefix(in this case, it is equal tov)