Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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-<sha>
# App version: full tag (e.g. v0.8.1) for releases, otherwise 0.0.0-<sha>
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
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/<username> image-local
Expand Down
2 changes: 1 addition & 1 deletion cli/pkg/kubectl/dev/plugin/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 4 additions & 2 deletions deploy/charts/backend/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion deploy/charts/backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 7 additions & 7 deletions hack/helm-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)"

Expand All @@ -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/
Expand Down