From c04dd84f808ab256cc4281815d9e4952898eb556 Mon Sep 17 00:00:00 2001 From: David Stone Date: Fri, 27 Nov 2026 12:17:57 -0700 Subject: [PATCH] fix: drop composer.json version key so Composer resolves release tags (GH#2158) --- .github/workflows/release.yml | 6 ++++++ bin/deploy.sh | 7 ++----- composer.json | 1 - 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fcb2f495d..7e931c668 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -65,6 +65,12 @@ jobs: PKG_VERSION=$(node -p "require('./package.json').version") CLASS_VERSION=$(grep -oP "const VERSION = '\K[^']+" inc/class-wp-ultimo.php) + # Composer drops VCS tags whose composer.json "version" disagrees with the tag (GH#2158). + if jq -e 'has("version")' composer.json > /dev/null; then + echo "Error: composer.json must not declare a version key; Composer derives it from the tag." + exit 1 + fi + echo "Tag version: ${{ env.VERSION }}" echo "Plugin header: $WP_VERSION" echo "readme.txt Stable tag: $README_VERSION" diff --git a/bin/deploy.sh b/bin/deploy.sh index c99191de7..d9d383bc3 100755 --- a/bin/deploy.sh +++ b/bin/deploy.sh @@ -7,7 +7,7 @@ set -euo pipefail # bin/deploy.sh 2.4.6-beta.1 (pre-release) # # This script: -# 1) Updates versions in plugin header, WP_Ultimo::VERSION, composer.json, package.json +# 1) Updates versions in plugin header, WP_Ultimo::VERSION, package.json # (and readme.txt Stable tag for stable releases only) # For stable releases, also replaces `@since n.e.x.t` placeholders (and the other # forms handled by bin/replace-next-version.sh) with the release version @@ -125,9 +125,6 @@ update_versions() { # WP_Ultimo const VERSION sed -i.bak -E "s/(const VERSION = ')[^']+(';)/\\1$VERSION\\2/" inc/class-wp-ultimo.php - # composer.json version - sed -i.bak -E '0,/"version"[[:space:]]*:[[:space:]]*"[^"]+"/ s//"version": '"\"$VERSION\""'/' composer.json - # package.json version sed -i.bak -E '0,/"version"[[:space:]]*:[[:space:]]*"[^"]+"/ s//"version": '"\"$VERSION\""'/' package.json @@ -136,7 +133,7 @@ update_versions() { printf '%s\n' "$VERSION" > VERSION fi - rm -f readme.txt.bak ultimate-multisite.php.bak inc/class-wp-ultimo.php.bak composer.json.bak package.json.bak + rm -f readme.txt.bak ultimate-multisite.php.bak inc/class-wp-ultimo.php.bak package.json.bak # `@since n.e.x.t` -> `@since $VERSION`. Pre-releases keep the placeholder: # the code ships in the final X.Y.Z, not in the beta. diff --git a/composer.json b/composer.json index a55bf9ce1..5bd66e41e 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,6 @@ "name": "ultimate-multisite/ultimate-multisite", "homepage": "https://UltimateMultisite.com", "description": "The Multisite Website as a Service (WaaS) plugin.", - "version": "2.18.0", "authors": [ { "name": "Arindo Duque",