Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions release-prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,23 @@ echo "Preparing release for version $VERSION (major: $MAJOR_VERSION)"
# Update Maven versions
mvn versions:set -DnewVersion="$VERSION" -DautoVersionSubmodules=true

# Portable sed for macOS and Linux
if [[ "$OSTYPE" == "darwin"* ]]; then
SED_CMD="sed -i ''"
else
SED_CMD="sed -i"
fi
Comment on lines +15 to +20
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the releaserc to run the commands in both operating systems, allowing us to see which files have been updated during the dry run, as well as the changelog.


# Update s3ec version in migration examples
sed -i '' "s/<s3ec.version>.*<\/s3ec.version>/<s3ec.version>$VERSION<\/s3ec.version>/g" migration_examples/v3-to-v4/v4/pom.xml
$SED_CMD "s/<s3ec.version>.*<\/s3ec.version>/<s3ec.version>$VERSION<\/s3ec.version>/g" migration_examples/v3-to-v4/v4/pom.xml

# Update API_VERSION_UNKNOWN with major version
sed -i '' "s/public static final String API_VERSION_UNKNOWN = \".*-unknown\"/public static final String API_VERSION_UNKNOWN = \"$MAJOR_VERSION-unknown\"/g" src/main/java/software/amazon/encryption/s3/internal/ApiNameVersion.java
$SED_CMD "s/public static final String API_VERSION_UNKNOWN = \".*-unknown\"/public static final String API_VERSION_UNKNOWN = \"$MAJOR_VERSION-unknown\"/g" src/main/java/software/amazon/encryption/s3/internal/ApiNameVersion.java

# Update EXPECTED_API_MAJOR_VERSION
sed -i '' "s/EXPECTED_API_MAJOR_VERSION = \"[0-9]*\"/EXPECTED_API_MAJOR_VERSION = \"$MAJOR_VERSION\"/g" src/test/java/software/amazon/encryption/s3/internal/ApiNameVersionTest.java
$SED_CMD "s/EXPECTED_API_MAJOR_VERSION = \"[0-9]*\"/EXPECTED_API_MAJOR_VERSION = \"$MAJOR_VERSION\"/g" src/test/java/software/amazon/encryption/s3/internal/ApiNameVersionTest.java

# Update version in README
sed -i '' "s/<version>.*<\/version>/<version>$VERSION<\/version>/g" README.md
$SED_CMD "s/<version>.*<\/version>/<version>$VERSION<\/version>/g" README.md

echo "Release preparation complete"
echo "Release preparation complete"
Loading