From 5971e79f4bb9bb437bccfbb6f225fb4847b9737d Mon Sep 17 00:00:00 2001 From: Rama Venkata Loya Date: Wed, 30 Oct 2024 17:23:30 +0530 Subject: [PATCH] updated the build_release script to use the version from the CHANGELOG --- ci/build_release | 6 ++++++ ci/publish_to_galaxy | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ci/build_release b/ci/build_release index 07baf889..45cc8440 100755 --- a/ci/build_release +++ b/ci/build_release @@ -2,12 +2,18 @@ set -euo pipefail +REPO="$(git rev-parse --show-toplevel)" +export COLLECTION_VERSION="$(cat "$REPO/VERSION" | cut -d'-' -f1)" TOP_LEVEL_DIR="$(cd "$(dirname "$BASH_SOURCE")"; pwd)/.." pushd "$TOP_LEVEL_DIR" >/dev/null docker run --rm -t \ -v "$TOP_LEVEL_DIR:/collection" \ python:3 /bin/bash -c " + # Verify and replace the version in the galaxy.yml file + if [[ -n \"$COLLECTION_VERSION\" ]] && ! grep -q \"version: '$COLLECTION_VERSION'\" /collection/galaxy.yml; then + sed -i 's/version: \".*\"/version: \"$COLLECTION_VERSION\"/' /collection/galaxy.yml + fi pip install ansible ansible-galaxy collection build --force --output /collection/. /collection " diff --git a/ci/publish_to_galaxy b/ci/publish_to_galaxy index 44a2aa16..d58c6d83 100755 --- a/ci/publish_to_galaxy +++ b/ci/publish_to_galaxy @@ -3,7 +3,7 @@ set -euo pipefail # Strip the 'v' from the Tag Name -TAG=${TAG_NAME//"v"} +TAG=${TAG//"v"} TOP_LEVEL_DIR="$(cd "$(dirname "$BASH_SOURCE")"; pwd)/.."