Skip to content

Commit

Permalink
Update net.researchgate.release plugin to 3.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Vampire committed Feb 17, 2023
1 parent f594319 commit 37324c8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import net.kautler.util.afterReleaseBuild
import net.kautler.util.beforeReleaseBuild
import net.kautler.util.checkoutMergeFromReleaseBranch
import net.kautler.util.createReleaseTag
import net.kautler.util.git
import net.kautler.util.preTagCommit
import net.kautler.util.release
import net.kautler.util.runBuildTasks
Expand Down Expand Up @@ -63,10 +62,11 @@ extra["release.newVersion"] = optionalString(project, "release.newVersion").getV
val majorVersion: String by project

release {
pushReleaseVersionBranch = "v$majorVersion"
tagTemplate = "v\$version"
pushReleaseVersionBranch.set("v$majorVersion")
tagTemplate.set("v\$version")
git {
signTag = true
requireBranch.set("master")
signTag.set(true)
}
}

Expand Down Expand Up @@ -145,7 +145,7 @@ tasks.githubPublish {
.get()
.grgit
.log {
includes.add(release.git.requireBranch)
includes.add(release.git.requireBranch.get())
github
.clientProvider
.get()
Expand Down Expand Up @@ -298,15 +298,15 @@ val checkBranchProtectionCompatibility by tasks.registering(Github::class) {
doLast {
check(
!repository
.getBranch(release.git.requireBranch)
.getBranch(release.git.requireBranch.get())
.protection
.enforceAdmins
.isEnabled
) {
"""
Please disable branch protection for administrators before triggering a release, for example using
gh api 'repos/{owner}/{repo}/branches/${release.git.requireBranch}/protection/enforce_admins' -X DELETE
gh api 'repos/{owner}/{repo}/branches/${release.git.requireBranch.get()}/protection/enforce_admins' -X DELETE
""".trimIndent()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package net.kautler.util

import net.researchgate.release.GitAdapter.GitConfig
import net.researchgate.release.ReleaseExtension
import org.gradle.api.Action
import org.gradle.api.Project
Expand All @@ -27,12 +26,6 @@ import org.gradle.api.tasks.TaskProvider
import org.gradle.kotlin.dsl.getByName
import org.gradle.kotlin.dsl.named

val ReleaseExtension.git
get() = getProperty("git") as GitConfig

fun ReleaseExtension.git(configure: GitConfig.() -> Unit) =
git.configure()

// part of work-around for https://github.com/gradle/gradle/issues/23747
val Project.release: ReleaseExtension
get() = extensions.getByName<ReleaseExtension>("release")
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ build-gradle-plugin-dependency-analysis = "1.19.0"
build-gradle-plugin-github = "3.0.0"
build-gradle-plugin-grgit = "5.0.0"
build-gradle-plugin-refresh-versions = "0.51.0"
build-gradle-plugin-release = "2.8.1"
build-gradle-plugin-release = "3.0.2"
build-gradle-plugin-versions = "0.45.0"
build-inject = "1"
build-kotlin = "1.8.10"
Expand Down

0 comments on commit 37324c8

Please sign in to comment.