Skip to content

Commit

Permalink
Merge pull request #7 from PAYONE-GmbH/prepare-release
Browse files Browse the repository at this point in the history
Prepare release
  • Loading branch information
ehrdi authored Aug 19, 2024
2 parents 3902301 + 962f1d2 commit e059b7b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Welcome to the Java SDK for the PAYONE Commerce Platform! This repository contai

```groovy
dependencies {
implementation group: 'io.github.payone-gmbh', name: 'pcp-serversdk-java', version: '0.0.1'
implementation group: 'io.github.payone-gmbh', name: 'pcp-serversdk-java', version: '0.0.2'
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ public CreateCheckoutResponse createCheckoutRequest(String merchantId, String co
.addPathSegment(PCP_PATH_SEGMENT_CHECKOUTS)
.build();

String jsonString = null;

jsonString = JsonSerializer.serializeToJson(payload);
String jsonString = JsonSerializer.serializeToJson(payload);

Request request = new Request.Builder()
.url(url)
Expand Down Expand Up @@ -157,9 +155,7 @@ public void updateCheckoutRequest(String merchantId, String commerceCaseId, Stri
.addPathSegment(checkoutId)
.build();

String jsonString = null;

jsonString = JsonSerializer.serializeToJson(payload);
String jsonString = JsonSerializer.serializeToJson(payload);

Request request = new Request.Builder()
.url(url)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ public void updateCommerceCaseRequest(String merchantId, String commerceCaseId,
.addPathSegment(commerceCaseId)
.build();

String jsonString = null;

jsonString = JsonSerializer.serializeToJson(payload);
String jsonString = JsonSerializer.serializeToJson(payload);

RequestBody formBody = RequestBody.create("{\"customer\":" + jsonString + "}", JSON);

Expand Down
4 changes: 4 additions & 0 deletions prepare-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ TAG=v$VERSION

BUILD_GRADLE_PATH="./lib/build.gradle"
SERVER_META_INFO_PATH="./lib/src/main/java/com/payone/commerce/platform/lib/utils/ServerMetaInfo.java"
README_PATH="./README.md"

# Update the version in the build.gradle file
sed -i '' "s/version = '[0-9]*\.[0-9]*\.[0-9]*'/version = '$VERSION'/" $BUILD_GRADLE_PATH
# Update the version in the ServerMetaInfo.java file
sed -i '' "s/JavaServerSDK\/v[0-9]*\.[0-9]*\.[0-9]*/JavaServerSDK\/$TAG/" $SERVER_META_INFO_PATH
# update the version in the readme file
sed -i '' "s/version: '[0-9]*\.[0-9]*\.[0-9]*'/version: '$VERSION'/g" $README_PATH

# Update the version number in the package.json file for changelog generation
sed -i '' -e "s/\"version\": \".*\"/\"version\": \"$VERSION\"/" package.json
Expand All @@ -40,6 +43,7 @@ jq --arg version "$VERSION" '

git add $BUILD_GRADLE_PATH
git add $SERVER_META_INFO_PATH
git add $README_PATH
git commit -m "Update version to $VERSION"
git tag -a $TAG -m "Release version $VERSION"
git push origin $TAG
Expand Down

0 comments on commit e059b7b

Please sign in to comment.