Skip to content

Commit d80813f

Browse files
authored
Merge pull request #45 from slonopotamus/release-logic-gradle
Move snapshot/release logic into build.gradle.kts
2 parents 53ac84c + 2d300b1 commit d80813f

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ jobs:
4040
install: true
4141
script:
4242
- openssl aes-256-cbc -K $encrypted_8e5c960335c9_key -iv $encrypted_8e5c960335c9_iv -in secring.gpg.enc -out secring.gpg -d
43-
- if [ -n "${TRAVIS_TAG}" ]; then ./gradlew publish closeAndReleaseRepository; else ./gradlew publish; fi
43+
- ./gradlew publish closeAndReleaseRepository

build.gradle.kts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,20 @@ subprojects {
153153
configure<SigningExtension> {
154154
isRequired = signingPassword != null && file(secretKeyRingFile).exists()
155155

156+
// TODO: Is it possible to access publishing extension in a safer way?
156157
val publishing: PublishingExtension by project.extensions
157158
sign(publishing.publications)
158159
}
159160
}
160161

162+
tasks.closeRepository.configure {
163+
onlyIf { !project.version.toString().endsWith("-SNAPSHOT") }
164+
}
165+
166+
tasks.releaseRepository.configure {
167+
onlyIf { !project.version.toString().endsWith("-SNAPSHOT") }
168+
}
169+
161170
nexusStaging {
162171
packageGroup = "ru.bozaro"
163172
username = ossrhUsername

0 commit comments

Comments
 (0)