Skip to content

Commit 4061187

Browse files
arifer612GiteaBot
authored andcommitted
Fix OCI image.version annotation for releases to use full semver (go-gitea#33698)
This commit fixes the docker build workflow such that semver-tagged releases use the full semver for the OCI `org.opencontainers.image.version` annotation, instead of using the major version only. This is done by changing the order of the tags that the `docker/metadata-action` action is told to generate. Since the tags that the action is told to generate are all of the same priority, the first in the list will be used to set the annotation. There is no need to fix the other two docker build workflows, i.e., (i) the nightly releases and (ii) the rc-tagged releases. This is because (i) the nightly releases do not get tagged with a semver, so the issue does not exist, and (ii) rc-tagged releases only get built with one tag, so the issue of needing to set an order of how tags are generated is irrelevant. Resolves go-gitea#33697.
1 parent 039924a commit 4061187

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/release-tag-version.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ jobs:
8888
# 1.2
8989
# 1.2.3
9090
tags: |
91+
type=semver,pattern={{version}}
9192
type=semver,pattern={{major}}
9293
type=semver,pattern={{major}}.{{minor}}
93-
type=semver,pattern={{version}}
9494
- name: Login to Docker Hub
9595
uses: docker/login-action@v3
9696
with:
@@ -126,9 +126,9 @@ jobs:
126126
# 1.2
127127
# 1.2.3
128128
tags: |
129+
type=semver,pattern={{version}}
129130
type=semver,pattern={{major}}
130131
type=semver,pattern={{major}}.{{minor}}
131-
type=semver,pattern={{version}}
132132
- name: Login to Docker Hub
133133
uses: docker/login-action@v3
134134
with:

0 commit comments

Comments
 (0)