Skip to content

Commit

Permalink
Merge pull request #25 from PAYONE-GmbH/develop
Browse files Browse the repository at this point in the history
Release/1.0.0
  • Loading branch information
ehrdi authored Aug 22, 2024
2 parents 58d349f + f92749d commit b49d5db
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 17 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# [1.0.0](https://github.com/PAYONE-GmbH/PCP-ServerSDK-php/compare/v0.1.0...v1.0.0) (2024-08-22)
### Features
* feat: provide updated api endpoints when calling getPredefinedHosts() ([3927c7eafe34b2ac9fb66dcecd9869b5dad644c8](https://github.com/PAYONE-GmbH/PCP-ServerSDK-php/commit/3927c7eafe34b2ac9fb66dcecd9869b5dad644c8))

### BREAKING CHANGE

* When the host for CommunicatorConfiguration is provided
`getPredefinedHosts()` it now points to a different url
# [0.1.0](https://github.com/PAYONE-GmbH/PCP-ServerSDK-php/compare/f7fc619bdc3a01a86a4d29d23946fa29d520fa31...v0.1.0) (2024-08-09)
### Bug Fixes
* fix: allow nullables to be compatible with api responses ([3d505149080ad09d1b9fe8eaa5a20928e5531bff](https://github.com/PAYONE-GmbH/PCP-ServerSDK-php/commit/3d505149080ad09d1b9fe8eaa5a20928e5531bff))
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"name": "PAYONE GmbH"
}
],
"version": "0.1.0",
"version": "1.0.0",
"require": {
"php": "~8.2||~8.3",
"ext-curl": "*",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"author": "PAYONE GmbH",
"license": "MIT",
"private": true,
"version": "0.1.0",
"version": "1.0.0",
"scripts": {
"changelog": "conventional-changelog -i CHANGELOG.md -s -r 0 --config ./changelog.config.js"
"changelog": "conventional-changelog -i CHANGELOG.md -s --config ./changelog.config.js"
},
"repository": {
"type": "git",
Expand Down
29 changes: 18 additions & 11 deletions prepare_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,47 +13,54 @@ fi

# Check if an argument is provided
if [ -z "$VERSION" ]; then
echo "Error: No version number provided."
echo "Usage: $0 <version>"
exit 1
echo "Error: No version number provided."
echo "Usage: $0 <version>"
exit 1
fi

# Check if the argument matches the format int.int.int
if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Valid version number: $VERSION"
echo "Valid version number: $VERSION"
else
echo "Error: Invalid version number format."
echo "Usage: $0 <version>"
exit 1
echo "Error: Invalid version number format."
echo "Usage: $0 <version>"
exit 1
fi

# tag should start with a 'v'
TAG="v${VERSION}"
COMMUNICATOR_CONFIG_CLASS_PATH="./src/PayoneCommercePlatform/Sdk/CommunicatorConfiguration.php"
COMPOSER_JSON_PATH="./composer.json"
PACKAGE_JSON_PATH="./package.json"
PACKAGE_LOCK_JSON_PATH="./package-lock.json"

SED_COMMUNICATOR_CONFIG_CMD=$(printf 's/public const SDK_VERSION = .[0-9]*\.[0-9]*\.[0-9]*./public const SDK_VERSION = %s/' "'${VERSION}'")

# Update the version in the CommunicatorConfiguration class
sed -i '' "$SED_COMMUNICATOR_CONFIG_CMD" $COMMUNICATOR_CONFIG_CLASS_PATH

# Update the version number in the composer.json file
jq --arg version "$VERSION" '.version = $version' composer.json > tmp.json && mv tmp.json composer.json
jq --arg version "$VERSION" '.version = $version' composer.json >tmp.json && mv tmp.json composer.json
# Update the version number in the package.json file
jq --arg version "$VERSION" '.version = $version' package.json > tmp.json && mv tmp.json package.json
jq --arg version "$VERSION" '.version = $version' package.json >tmp.json && mv tmp.json package.json
# Update the version number in the package-lock.json file for changelog generation
jq --arg version "$VERSION" '
.version = $version |
.packages[""].version = $version
' package-lock.json >tmp.json && mv tmp.json package-lock.json
rm -f tmp.json

git add "$COMMUNICATOR_CONFIG_CLASS_PATH" "$COMPOSER_JSON_PATH"
git commit -m "Update version to $VERSION"
git add $PACKAGE_JSON_PATH
git add $PACKAGE_LOCK_JSON_PATH
npm install
npm run changelog
git add CHANGELOG.md
git tag -a $TAG -m "Release version $VERSION"
git commit -m "Update version to $VERSION"

echo "Version updated to $VERSION and tagged in Git."
echo ""
echo "If this was a mistake, you can run"
echo " git reset --soft HEAD~1"
echo " git tag -d ${TAG}"

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class CommunicatorConfiguration
{
public const SDK_VERSION = '0.1.0';
public const SDK_VERSION = '1.0.0';

/**
* Api key for the PAYONE Commerce Platform
Expand Down

0 comments on commit b49d5db

Please sign in to comment.