diff --git a/Makefile b/Makefile index 5ec1ba1f..e05d2f7f 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,10 @@ else GORELEASER_ID = $(FLAVOR) endif -VERSION := $(shell git describe --always) +# Use GORELEASER_CURRENT_TAG if set (from GitHub Actions), otherwise derive from git +ifeq ($(origin VERSION), undefined) +VERSION := $(or $(GORELEASER_CURRENT_TAG),$(shell git describe --tags --always 2>/dev/null || echo "0.0.0-dev")) +endif # Tooling versions GORELEASER_VERSION=v2.12.0 diff --git a/cloudsmith.sh b/cloudsmith.sh index b93c531f..9fb4ae74 100644 --- a/cloudsmith.sh +++ b/cloudsmith.sh @@ -1,3 +1,10 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [[ -z "${VERSION:-}" ]]; then + echo "Error: VERSION environment variable is not set. Please set VERSION (e.g., '1.2.3') before running cloudsmith.sh." >&2 + exit 1 +fi # Upload Platform.sh packages cloudsmith push deb platformsh/cli/any-distro/any-version dist/platformsh-cli_${VERSION}_linux_arm64.deb cloudsmith push deb platformsh/cli/any-distro/any-version dist/platformsh-cli_${VERSION}_linux_amd64.deb