Mohammed Naser | eead9b9 | 2024-09-06 09:22:39 -0400 | [diff] [blame] | 1 | #!/bin/bash -xe |
| 2 | |
| 3 | VERSION=$1 |
| 4 | LATEST_VERSION=$2 |
| 5 | |
| 6 | if [ -z "$VERSION" ] || [ -z "$LATEST_VERSION" ]; then |
| 7 | echo "Usage: $0 <version> <latest_version>" |
| 8 | exit 1 |
| 9 | fi |
| 10 | |
| 11 | # Update the version |
| 12 | sed -i s/^version:.*/version:\ $VERSION/ galaxy.yml |
| 13 | sed -i s/^atmosphere_version:.*/atmosphere_version:\ $VERSION/ roles/defaults/defaults/main.yml |
| 14 | |
| 15 | # Create release commit |
| 16 | git add galaxy.yml roles/defaults/defaults/main.yml |
| 17 | git commit -m "Release $VERSION" |
| 18 | |
| 19 | # Push the release commit |
| 20 | git push |
| 21 | |
| 22 | # Create GitHub release with gh CLI |
| 23 | gh release create v$VERSION --target $(git rev-parse HEAD) --generate-notes --latest=$LATEST_VERSION |