Skip to content

Commit 67b0074

Browse files
authored
build: introduce stable-{variant} image tags (#3468)
1 parent a890066 commit 67b0074

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

.github/workflows/build-multiarch.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,18 @@ jobs:
113113
${{ github.repository_owner }}/minecraft-server
114114
ghcr.io/${{ github.repository_owner }}/minecraft-server
115115
tags: |
116-
# For the "main" variant, it gets the tag as-is, without suffix
117-
type=ref,event=tag,enable=${{ matrix.variant == env.MAIN_VARIANT }}
118-
# and each variant (including main one) gets the tag with the variant suffix, such as 2023.1.1-java17
119-
type=ref,event=tag,suffix=-${{ matrix.variant }}
116+
# Apply the variant as a moving tag for most recent commit per variant
117+
type=raw,value=${{ matrix.variant }},enable=${{ github.ref_name == github.event.repository.default_branch }}
118+
# For the "main" variant, it gets the tag as-is
119+
type=pep440,pattern={{version}},enable=${{ matrix.variant == env.MAIN_VARIANT }}
120+
# ...and all variants (including main one) get the tag with the variant suffix, such as 2023.1.1-java17
121+
type=pep440,pattern={{version}},suffix=-${{ matrix.variant }}
122+
# latest tag gets a moving 'stable' image tag applied to the main variant
123+
type=pep440,pattern=stable,enable=${{ matrix.variant == env.MAIN_VARIANT }}
124+
# ...and qualified stable for all variants
125+
type=pep440,pattern=stable,suffix=-${{ matrix.variant }}
120126
# for building test/* branch images
121127
type=ref,event=branch,suffix=-${{ matrix.variant }},enable=${{ github.ref_name != github.event.repository.default_branch }}
122-
# latest repo tag gets a moving 'stable' image tag applied to the main variant
123-
type=raw,value=stable,enable=${{ github.ref_type == 'tag' && matrix.variant == env.MAIN_VARIANT }}
124-
# apply the variant as a moving tag for most recent commit per variant
125-
type=raw,value=${{ matrix.variant }},enable=${{ github.ref_name == github.event.repository.default_branch }}
126128
# for backward compatibility with users referencing java8-multiarch, this will set an extra label on java8
127129
type=raw,value=java8-multiarch,enable=${{ matrix.variant == 'java8' && github.ref_name == github.event.repository.default_branch }}
128130
# NOTE this identifies which variant will be published as "latest", which isn't

0 commit comments

Comments
 (0)