From d99ae0469905e0c1030e9df9d5f34062a3605d21 Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Fri, 6 Sep 2024 09:22:39 -0400 Subject: [PATCH] Add release script --- build/release.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 build/release.sh diff --git a/build/release.sh b/build/release.sh new file mode 100755 index 000000000..e73b6137e --- /dev/null +++ b/build/release.sh @@ -0,0 +1,23 @@ +#!/bin/bash -xe + +VERSION=$1 +LATEST_VERSION=$2 + +if [ -z "$VERSION" ] || [ -z "$LATEST_VERSION" ]; then + echo "Usage: $0 " + exit 1 +fi + +# Update the version +sed -i s/^version:.*/version:\ $VERSION/ galaxy.yml +sed -i s/^atmosphere_version:.*/atmosphere_version:\ $VERSION/ roles/defaults/defaults/main.yml + +# Create release commit +git add galaxy.yml roles/defaults/defaults/main.yml +git commit -m "Release $VERSION" + +# Push the release commit +git push + +# Create GitHub release with gh CLI +gh release create v$VERSION --target $(git rev-parse HEAD) --generate-notes --latest=$LATEST_VERSION