diff --git a/.github/workflows/image.yaml b/.github/workflows/image.yaml index ac1f1ea7d..325ef873b 100644 --- a/.github/workflows/image.yaml +++ b/.github/workflows/image.yaml @@ -55,12 +55,11 @@ jobs: echo "org.opencontainers.image.version=${{ github.ref_name }}" echo 'EOF' } >> "$GITHUB_ENV" - # Helm chart version: semver from tag, otherwise 0.0.0- + # App version: full tag (e.g. v0.8.1) for releases, otherwise 0.0.0- if [[ "${{ github.ref_type }}" == "tag" ]]; then - chart_version="${{ github.ref_name }}" - echo "CHART_VERSION=${chart_version#v}" >> "$GITHUB_ENV" + echo "APP_VERSION=${{ github.ref_name }}" >> "$GITHUB_ENV" else - echo "CHART_VERSION=0.0.0-${{ github.sha }}" >> "$GITHUB_ENV" + echo "APP_VERSION=0.0.0-${{ github.sha }}" >> "$GITHUB_ENV" fi - name: Login to GitHub Container Registry diff --git a/Makefile b/Makefile index de54516da..bfc5040cb 100644 --- a/Makefile +++ b/Makefile @@ -420,11 +420,12 @@ build-web: # Image / release configuration. # IMAGE_TAGS is the space-separated list of tag suffixes applied to each component image. # IMAGE_PUSH_PLATFORMS is the platform list for `image-push` (multi-arch by default). -# CHART_VERSION is the helm chart version; defaults to 0.0.0-$REV. +# APP_VERSION is the application version passed to helm-build.sh; defaults to 0.0.0-$REV. +# helm-build.sh strips the leading "v" to derive a valid Helm chart semver. # IMAGE_METADATA_DIR holds buildx metadata files used by `image-sign`. export IMAGE_TAGS ?= $(REV) IMAGE_PUSH_PLATFORMS ?= linux/amd64,linux/arm64 -export CHART_VERSION ?= 0.0.0-$(REV) +export APP_VERSION ?= 0.0.0-$(REV) IMAGE_METADATA_DIR ?= $(BUILD_DIR)/image-metadata # Example: make IMAGE_REPO=ghcr.io/ image-local diff --git a/cli/pkg/kubectl/dev/plugin/create.go b/cli/pkg/kubectl/dev/plugin/create.go index d282ea6d4..18bda475a 100644 --- a/cli/pkg/kubectl/dev/plugin/create.go +++ b/cli/pkg/kubectl/dev/plugin/create.go @@ -70,7 +70,7 @@ type DevOptions struct { } // fallbackAssetVersion is used when unable to fetch the latest version -const fallbackAssetVersion = "0.7.1" +const fallbackAssetVersion = "0.8.1" // gitHubRelease represents a GitHub release response type gitHubRelease struct { diff --git a/deploy/charts/backend/Chart.yaml b/deploy/charts/backend/Chart.yaml index b10e2e0dd..131b99318 100644 --- a/deploy/charts/backend/Chart.yaml +++ b/deploy/charts/backend/Chart.yaml @@ -15,10 +15,12 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 +# NOTE: updated by helm-build.sh during the build — do not edit manually. +version: 0.0.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "v0.7.1" +# NOTE: updated by helm-build.sh during the build — do not edit manually. +appVersion: "0.0.0" diff --git a/deploy/charts/backend/README.md b/deploy/charts/backend/README.md index 9bc98578a..038c75c5e 100644 --- a/deploy/charts/backend/README.md +++ b/deploy/charts/backend/README.md @@ -2,7 +2,7 @@ A Helm chart for kube-bind backend deployment -![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.7.1](https://img.shields.io/badge/AppVersion-v0.7.1-informational?style=flat-square) +![Version: 0.0.0](https://img.shields.io/badge/Version-0.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.0.0](https://img.shields.io/badge/AppVersion-0.0.0-informational?style=flat-square) ## Installation diff --git a/hack/helm-build.sh b/hack/helm-build.sh index f21453764..cb9285f12 100755 --- a/hack/helm-build.sh +++ b/hack/helm-build.sh @@ -16,13 +16,13 @@ set -eu -# Inputs (env vars): -# REV short git sha (required if CHART_VERSION is unset) -# CHART_VERSION chart version string; default: 0.0.0-$REV +APP_VERSION="${APP_VERSION:-0.0.0-${REV:-}}" +if [[ -z "$APP_VERSION" || "$APP_VERSION" == "0.0.0-" ]]; then + echo "ERROR: APP_VERSION or REV must be set" >&2; exit 1 +fi +CHART_VERSION="${APP_VERSION#v}" -: "${CHART_VERSION:=0.0.0-${REV:?REV must be set when CHART_VERSION is unset}}" - -echo "Building Helm charts (version: $CHART_VERSION)..." +echo "Building Helm charts (appVersion: $APP_VERSION, chartVersion: $CHART_VERSION)..." HELM="$(UGET_PRINT_PATH=absolute make --no-print-directory install-helm)" @@ -33,7 +33,7 @@ for chart_dir in deploy/charts/*/; do cp "${chart_dir}Chart.yaml" "${chart_dir}Chart.yaml.bak" sed -i.tmp "s/^version:.*/version: $CHART_VERSION/" "${chart_dir}Chart.yaml" - sed -i.tmp "s/^appVersion:.*/appVersion: $CHART_VERSION/" "${chart_dir}Chart.yaml" + sed -i.tmp "s/^appVersion:.*/appVersion: \"$APP_VERSION\"/" "${chart_dir}Chart.yaml" rm -f "${chart_dir}Chart.yaml.tmp" "$HELM" package "$chart_dir" --version "$CHART_VERSION" --destination ./bin/