Skip to content

Commit

Permalink
Bump com.vanniktech.maven.publish from 0.19.0 to 0.25.2 (#16)
Browse files Browse the repository at this point in the history
* Bump com.vanniktech.maven.publish from 0.19.0 to 0.25.2

Bumps [com.vanniktech.maven.publish](https://github.com/vanniktech/gradle-maven-publish-plugin) from 0.19.0 to 0.25.2.
- [Release notes](https://github.com/vanniktech/gradle-maven-publish-plugin/releases)
- [Changelog](https://github.com/vanniktech/gradle-maven-publish-plugin/blob/main/CHANGELOG.md)
- [Commits](vanniktech/gradle-maven-publish-plugin@0.19.0...0.25.2)

---
updated-dependencies:
- dependency-name: com.vanniktech.maven.publish
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump com.vanniktech.maven.publish from 0.19.0 to 0.25.2

Bumps [com.vanniktech.maven.publish](https://github.com/vanniktech/gradle-maven-publish-plugin) from 0.19.0 to 0.25.2.
- [Release notes](https://github.com/vanniktech/gradle-maven-publish-plugin/releases)
- [Changelog](https://github.com/vanniktech/gradle-maven-publish-plugin/blob/main/CHANGELOG.md)
- [Commits](vanniktech/gradle-maven-publish-plugin@0.19.0...0.25.2)

---
updated-dependencies:
- dependency-name: com.vanniktech.maven.publish
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Update releasing setup

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Zac Sweers <[email protected]>
  • Loading branch information
dependabot[bot] and ZacSweers committed Jun 11, 2023
1 parent dffdd7f commit 7e25493
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 19 deletions.
11 changes: 3 additions & 8 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
Releasing
=========

1. Change the version in `gradle.properties` to a non-SNAPSHOT version.
2. Update the `CHANGELOG.md` for the impending release.
3. `git commit -am "Prepare for release X.Y.Z."` (where X.Y.Z is the new version)
4. `git tag -a X.Y.Z -m "Version X.Y.Z"` (where X.Y.Z is the new version)
5. `./gradlew publish && ./gradlew closeAndReleaseRepository`
6. Update the `gradle.properties` to the next SNAPSHOT version.
7. `git commit -am "Prepare next development version."`
8. `git push && git push --tags`
1. Update the `CHANGELOG.md` for the impending release.
2. Run `./release.sh <version>`.
3. Publish the release on the repo's releases tab.
21 changes: 10 additions & 11 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
[versions]
kotlin = "1.8.22"
ktfmt = "0.43"
jvmTarget = "17"
kotlin = "1.6.10"
ktfmt = "0.34"
jvmTarget = "1.8"

[plugins]
detekt = { id = "io.gitlab.arturbosch.detekt", version = "1.23.0" }
dokka = { id = "org.jetbrains.dokka", version = "1.8.20" }
lint = { id = "com.android.lint", version = "8.0.2" }
mavenPublish = { id = "com.vanniktech.maven.publish", version = "0.19.0" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
spotless = { id = "com.diffplug.spotless", version = "6.19.0" }
binaryCompatibilityValidator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version = "0.13.2" }
detekt = { id = "io.gitlab.arturbosch.detekt", version = "1.19.0" }
dokka = { id = "org.jetbrains.dokka", version = "1.6.10" }
lint = { id = "com.android.lint", version = "7.1.2" }
mavenPublish = { id = "com.vanniktech.maven.publish", version = "0.25.2" }
spotless = { id = "com.diffplug.spotless", version = "6.3.0" }
binaryCompatibilityValidator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version = "0.8.0" }

[libraries]
clikt = "com.github.ajalt.clikt:clikt:3.5.2"
kotlinShell = "eu.jrie.jetbrains:kotlin-shell-core:0.2.1"
okio = "com.squareup.okio:okio:3.3.0"
junit = "junit:junit:4.13.2"
truth = "com.google.truth:truth:1.1.4"
truth = "com.google.truth:truth:1.1.3"
60 changes: 60 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/usr/bin/env bash

set -exo pipefail

# Helper function to increment a semantic version string.
function increment_version() {
local delimiter=.
# shellcheck disable=SC2207
local array=($(echo "$1" | tr $delimiter '\n'))
local version_type=$2
local major=${array[0]}
local minor=${array[1]}
local patch=${array[2]}

if [ "$version_type" = "--major" ]; then
major=$((major + 1))
minor=0
patch=0
elif [ "$version_type" = "--minor" ]; then
minor=$((minor + 1))
patch=0
elif [ "$version_type" = "--patch" ]; then
patch=$((patch + 1))
else
echo "Invalid version type. Must be one of: '--major', '--minor', '--patch'"
exit 1
fi

incremented_version="$major.$minor.$patch"

echo "Incremented version: $incremented_version"
}

# Gets a property out of a .properties file
# usage: getProperty $key $filename
function getProperty() {
grep "${1}" "$2" | cut -d'=' -f2
}

NEW_VERSION=$1
NEXT_VERSION="$(increment_version "$NEW_VERSION" --minor)-SNAPSHOT"
SNAPSHOT_VERSION=$(getProperty 'VERSION_NAME' gradle.properties)

echo "Publishing $NEW_VERSION"

# Prepare release
sed -i '' "s/${SNAPSHOT_VERSION}/${NEW_VERSION}/g" gradle.properties
git commit -am "Prepare for release $NEW_VERSION."
git tag -a "$NEW_VERSION" -m "Version $NEW_VERSION"

# Publish
./gradlew publish -x dokkaHt .ml

# Prepare next snapshot
echo "Updating snapshot version to $NEXT_VERSION"
sed -i '' "s/${NEW_VERSION}/${NEXT_VERSION}/g" gradle.properties
git commit -am "Prepare next development version."

# Push it all up
git push && git push --tags

0 comments on commit 7e25493

Please sign in to comment.