Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
[
"@semantic-release/exec",
{
"verifyReleaseCmd": "bash ./release-prepare.sh ${nextRelease.version}",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what's the point of also running the script as verifyRelease? prepare seems more accurate for what the script does.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It appears that when we run in dry-run mode, we will not be able to see which files are being updated. Above change allowed us to test file changes during dry-run mode.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Maybe, I'll remove verifyRelease for this fix and cut a new PR after the release.

"prepareCmd": "bash ./release-prepare.sh ${nextRelease.version}"
}
],
Expand Down
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
Copy Markdown
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