Skip to content

Commit

Permalink
Merge tag '2023.9.0' into develop
Browse files Browse the repository at this point in the history
2023.9.0
  • Loading branch information
sfeilmeier committed Sep 1, 2023
2 parents f0b0527 + 163f82b commit a97a176
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class OpenemsConstants {
/**
* The additional version string.
*/
public static final String VERSION_STRING = "SNAPSHOT";
public static final String VERSION_STRING = "";

/**
* The complete version as a SemanticVersion.
Expand Down
60 changes: 26 additions & 34 deletions tools/prepare-release.sh
Original file line number Diff line number Diff line change
@@ -1,43 +1,35 @@
# Prepares a Release
#!/bin/bash
#
# - Removes the SNAPSHOT tag from version
# Prepares a Release by removing the SNAPSHOT tag from version
#
# E.g. increases 2020.1.0-SNAPSHOT to 2020.1.0
# i.e. changes 2023.9.0-SNAPSHOT to 2023.9.0

# Basic definitions
release_date=$(date --iso-8601)
openems_constants="io.openems.common/src/io/openems/common/OpenemsConstants.java"
package_json="ui/package.json"
package_lock="ui/package-lock.json"
changelog_constants="ui/src/app/changelog/view/component/changelog.constants.ts"
set -e

# Reset files
git checkout $openems_constants
git checkout $package_json
git checkout $package_lock
git checkout $changelog_constants
main() {
initialize_environment
common_update_version_in_code
common_build_ui
echo "# Ready for commit: "Push version to $VERSION""
}

# Find new Version"
major=$(grep 'VERSION_MAJOR =' $openems_constants | sed 's/^.*= \([0-9]\+\);/\1/')
minor=$(grep 'VERSION_MINOR =' $openems_constants | sed 's/^.*= \([0-9]\+\);/\1/')
patch=$(grep 'VERSION_PATCH =' $openems_constants | sed 's/^.*= \([0-9]\+\);/\1/')
new_version="${major}.${minor}.${patch}"
echo "# Release version: $new_version"
echo "# date: $release_date"
initialize_environment() {
# Set working directory
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
cd ${SCRIPT_DIR}/..

echo "# Update $openems_constants"
sed --in-place 's/\(public .* VERSION_STRING = "\)SNAPSHOT\(".*$\)/\1\2/' $openems_constants
# Include commons
source $SCRIPT_DIR/common.sh
common_initialize_environment

echo "# Update $package_json"
sed --in-place "s/\(\"version\": \"\).*\(\".*$\)/\1$new_version\2/" $package_json
# Target version
VERSION_STRING=""
VERSION="$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH"

echo "# Update $package_lock"
sed --in-place "s/\(^ \"version\": \"\).*\(\".*$\)/\1$new_version\2/" $package_lock
# Reset files
git checkout $SRC_OPENEMS_CONSTANTS 2>/dev/null
git checkout $SRC_PACKAGE_JSON 2>/dev/null
git checkout $SRC_CHANGELOG_CONSTANTS 2>/dev/null
}

echo "# Update $changelog_constants"
sed --in-place "s/\(UI_VERSION = \).*$/\1\"$version_string\";/" $changelog_constants

echo "# Finished"

echo ""
echo "# Ready for commit: \"Push version to $new_version\""
main; exit
4 changes: 2 additions & 2 deletions ui/package-lock.json

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

2 changes: 1 addition & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openems-ui",
"version": "2023.9.0-SNAPSHOT",
"version": "2023.9.0",
"license": "AGPL-3.0",
"private": true,
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/changelog/view/component/changelog.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Role } from "src/app/shared/type/role";

export class Changelog {

public static readonly UI_VERSION = "2023.9.0-SNAPSHOT";
public static readonly UI_VERSION = "2023.9.0";

public static product(...products: Product[]) {
return products.map(product => Changelog.link(product.name, product.url)).join(", ") + '. ';
Expand Down

0 comments on commit a97a176

Please sign in to comment.