Mohammed Naser | eead9b9 | 2024-09-06 09:22:39 -0400 | [diff] [blame] | 1 | #!/bin/bash -xe |
| 2 | |
| 3 | VERSION=$1 |
Mohammed Naser | eead9b9 | 2024-09-06 09:22:39 -0400 | [diff] [blame] | 4 | |
Mohammed Naser | 28df411 | 2025-01-26 14:07:25 -0500 | [diff] [blame] | 5 | if [ -z "$VERSION" ]; then |
Mohammed Naser | eead9b9 | 2024-09-06 09:22:39 -0400 | [diff] [blame] | 6 | echo "Usage: $0 <version> <latest_version>" |
| 7 | exit 1 |
| 8 | fi |
| 9 | |
| 10 | # Update the version |
| 11 | sed -i s/^version:.*/version:\ $VERSION/ galaxy.yml |
| 12 | sed -i s/^atmosphere_version:.*/atmosphere_version:\ $VERSION/ roles/defaults/defaults/main.yml |
| 13 | |
| 14 | # Create release commit |
| 15 | git add galaxy.yml roles/defaults/defaults/main.yml |
| 16 | git commit -m "Release $VERSION" |
| 17 | |
Mohammed Naser | 28df411 | 2025-01-26 14:07:25 -0500 | [diff] [blame] | 18 | # Create a local tag |
| 19 | git tag v$VERSION |
Mohammed Naser | eead9b9 | 2024-09-06 09:22:39 -0400 | [diff] [blame] | 20 | |
Mohammed Naser | 28df411 | 2025-01-26 14:07:25 -0500 | [diff] [blame] | 21 | # Push the release commit |
| 22 | git push gerrit refs/heads/$(git rev-parse --abbrev-ref HEAD) |
| 23 | git push --tags gerrit refs/heads/$(git rev-parse --abbrev-ref HEAD) |