Skip to content

Commit d56e1ac

Browse files
committed
update README with compose multiplatform version
1 parent 9c0221a commit d56e1ac

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

.github/version.sh

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,29 @@ set -e
77

88
SEMVER_REG="([[:digit:]]+(\.[[:digit:]]+)+)"
99

10+
README_FILE="$PARENT/README.md"
11+
VERSION_FILE="$PARENT/gradle/libs.versions.toml"
12+
1013
NEW_VERSION="$ORG_GRADLE_PROJECT_VERSION_NAME"
1114
if [ -z "$NEW_VERSION" ]; then
1215
NEW_VERSION="$1"
13-
if [ -z "$NEW_VERSION" ]; then
14-
echo "ORG_GRADLE_PROJECT_VERSION_NAME is not set and no version was specified!"
15-
printf "Usage:\n\t./version.sh <new-version>"
16-
exit 1
17-
fi
18-
fi
16+
if [ ! -z "$NEW_VERSION" ]; then
17+
echo "Update README with version: '$NEW_VERSION'"
1918

20-
echo "Update README with version: '$NEW_VERSION'"
19+
# Update artifact versions in README.md
20+
sed -i '' -E "s/\:$SEMVER_REG\"\)/\:$NEW_VERSION\"\)/" "$README_FILE"
2121

22-
README_FILE="$PARENT/README.md"
23-
VERSION_FILE="$PARENT/gradle/libs.versions.toml"
22+
# Update version catalog in README.md
23+
sed -i '' -E "s/dragselectcompose = \"$SEMVER_REG\"/dragselectcompose = \"$NEW_VERSION\"/" "$README_FILE"
24+
fi
25+
fi
2426

2527
# Update Kotlin badge in README.md
2628
LIBS_KOTLIN_VERSION=$(grep "kotlin = " "$VERSION_FILE" | cut -d= -f2 | tr -d ' "')
2729
echo "Updating Kotlin version: '$LIBS_KOTLIN_VERSION'"
2830
sed -i '' -E "s/kotlin-v$SEMVER_REG/kotlin-v$LIBS_KOTLIN_VERSION/" "$README_FILE"
2931

30-
# Update artifact versions in README.md
31-
sed -i '' -E "s/\:$SEMVER_REG\"\)/\:$NEW_VERSION\"\)/" "$README_FILE"
32-
33-
# Update version catalog in README.md
34-
sed -i '' -E "s/dragselectcompose = \"$SEMVER_REG\"/dragselectcompose = \"$NEW_VERSION\"/" "$README_FILE"
32+
# Update Compose Multiplatform badge in README.md
33+
LIBS_COMPOSE_VERSION=$(grep "compose-plugin = " "$VERSION_FILE" | cut -d= -f2 | tr -d ' "')
34+
echo "Updating Compose version: '$LIBS_COMPOSE_VERSION'"
35+
sed -i '' -E "s/Compose%20Multiplatform-v$SEMVER_REG/Compose%20Multiplatform-v$LIBS_COMPOSE_VERSION/" "$README_FILE"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![Verify Gradle](https://github.com/jordond/drag-select-compose/actions/workflows/verify-gradle.yml/badge.svg)](https://github.com/jordond/drag-select-compose/actions/workflows/verify-gradle.yml)
77
[![License](https://img.shields.io/github/license/jordond/drag-select-compose)](http://www.apache.org/licenses/LICENSE-2.0)
88

9-
[![Compose Multiplatform](https://img.shields.io/badge/Compose%20Multiplatform-v1.4.0-blue)](https://github.com/JetBrains/compose-multiplatform)
9+
[![Compose Multiplatform](https://img.shields.io/badge/Compose%20Multiplatform-v1.4.1-blue)](https://github.com/JetBrains/compose-multiplatform)
1010
![badge-android](http://img.shields.io/badge/platform-android-6EDB8D.svg?style=flat)
1111
![badge-ios](http://img.shields.io/badge/platform-ios-CDCDCD.svg?style=flat)
1212
![badge-desktop](http://img.shields.io/badge/platform-desktop-DB413D.svg?style=flat)

0 commit comments

Comments
 (0)