Skip to content

Commit 6224eca

Browse files
authored
Do not remove the 'v' prefix from chart versions (#821)
* Change format of non-release chart versions Our non-release chart versions were using semver pre-release format (version appended by a hyphen and an identifier). This commit changes the format by appending build metadata, which uses a plus instead of a hyphen. The benefit of this change is that pre-release version identifiers must not include leading zeros, whereas build metadata can contain any ASCII alphanumerics and hyphens without further restrictions. Since we append a short git commit sha to the semver version, we can't rule out that the sha might start with a zero. * Do not remove the 'v' prefix from chart versions Our other artifacts, such as container images, all use the 'v' prefix for their versions. Keeping the prefix for the chart versions as well ensures taht our versioning scheme is consistent.
1 parent 5ab2f32 commit 6224eca

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

.github/workflows/release-chart.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ jobs:
4343
run: |
4444
if [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/main" ]]; then
4545
# Use SHA for main branch
46-
CHART_VERSION="0.0.0-$(echo ${{ github.sha }} | cut -c1-7)"
46+
CHART_VERSION="v0.0.0+$(echo ${{ github.sha }} | cut -c1-7)"
4747
elif [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
48-
# Use tag version (strip 'v' prefix)
49-
CHART_VERSION="${GITHUB_REF#refs/tags/v}"
48+
# Use tag version
49+
CHART_VERSION="${GITHUB_REF_NAME}"
5050
else
5151
# Use PR SHA for dry run
52-
CHART_VERSION="0.0.0-$(echo ${{ github.sha }} | cut -c1-7)"
52+
CHART_VERSION="v0.0.0+$(echo ${{ github.sha }} | cut -c1-7)"
5353
fi
5454
echo "version=$CHART_VERSION" >> $GITHUB_OUTPUT
5555
@@ -67,4 +67,4 @@ jobs:
6767
run: |
6868
helm push gardener-extension-provider-ironcore-${{ steps.chart_version.outputs.version }}.tgz oci://ghcr.io/${{ github.repository_owner }}/charts
6969
helm push gardener-extension-admission-ironcore-runtime-${{ steps.chart_version.outputs.version }}.tgz oci://ghcr.io/${{ github.repository_owner }}/charts
70-
helm push gardener-extension-admission-ironcore-application-${{ steps.chart_version.outputs.version }}.tgz oci://ghcr.io/${{ github.repository_owner }}/charts
70+
helm push gardener-extension-admission-ironcore-application-${{ steps.chart_version.outputs.version }}.tgz oci://ghcr.io/${{ github.repository_owner }}/charts

0 commit comments

Comments
 (0)