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