-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve release process automation steps.
- Loading branch information
1 parent
f5d0c13
commit c33c70e
Showing
5 changed files
with
69 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
# Strip leading 'v' if present | ||
NEXT_RELEASE="${1-}" | ||
NEXT_RELEASE="${NEXT_RELEASE#v}" | ||
|
||
if [[ -z "${NEXT_RELEASE}" ]]; then | ||
echo "Usage: $0 <new-version>" >&2 | ||
exit 1 | ||
elif ! [[ "${NEXT_RELEASE}" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then | ||
echo "Error: '${NEXT_RELEASE}' is not a valid semantic version." >&2 | ||
echo "Usage: $0 <new-version>" >&2 | ||
exit 1 | ||
fi | ||
|
||
LAST_RELEASE="$(awk -F\" '/sh.christian.ozone:bluesky/ { print $4 }' < gradle/libs.versions.toml)" | ||
|
||
properties_files="$(find . -name gradle.properties)" | ||
for file in $properties_files; do | ||
sed -i '' "s/POM_VERSION=.*/POM_VERSION=$NEXT_RELEASE/g" "$file" | ||
done | ||
|
||
sed -i '' "s/$LAST_RELEASE/$NEXT_RELEASE/g" gradle/libs.versions.toml | ||
sed -i '' "s/$LAST_RELEASE/$NEXT_RELEASE/g" README.md | ||
|
||
git add README.md | ||
git add $properties_files | ||
git add gradle/libs.versions.toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
git checkout main | ||
|
||
if [[ -n "$(git status --porcelain)" ]]; then | ||
echo "Error: Uncommitted changes present. Please re-run with no local changes." >&2 | ||
exit 1 | ||
fi | ||
|
||
# Strip leading 'v' if present | ||
NEXT_RELEASE="${1-}" | ||
NEXT_RELEASE="${NEXT_RELEASE#v}" | ||
|
||
./scripts/bump_version.sh "${NEXT_RELEASE}" | ||
|
||
git commit -m "Releasing v${NEXT_RELEASE}" | ||
git tag "v$NEXT_RELEASE" --force |