-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from th2-net/release-version-fix
sonatype publishing
- Loading branch information
Showing
9 changed files
with
163 additions
and
176 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Dev build and publish - Docker and Sonatype | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- master | ||
- version-* | ||
|
||
jobs: | ||
build-job: | ||
uses: th2-net/.github/.github/workflows/compound-java-dev.yml@main | ||
with: | ||
build-target: 'Docker,Sonatype' | ||
docker-username: ${{ github.actor }} | ||
secrets: | ||
docker-password: ${{ secrets.GITHUB_TOKEN }} | ||
sonatypeUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }} | ||
sonatypePassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} | ||
sonatypeSigningKey: ${{ secrets.SONATYPE_GPG_ARMORED_KEY }} | ||
sonatypeSigningPassword: ${{ secrets.SONATYPE_SIGNING_PASSWORD }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Release build and publish - Docker and Sonatype | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- version-* | ||
paths: | ||
- gradle.properties | ||
|
||
jobs: | ||
build-job: | ||
uses: th2-net/.github/.github/workflows/compound-java.yml@main | ||
with: | ||
build-target: 'Docker,Sonatype' | ||
docker-username: ${{ github.actor }} | ||
secrets: | ||
docker-password: ${{ secrets.GITHUB_TOKEN }} | ||
sonatypeUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }} | ||
sonatypePassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} | ||
sonatypeSigningKey: ${{ secrets.SONATYPE_GPG_ARMORED_KEY }} | ||
sonatypeSigningPassword: ${{ secrets.SONATYPE_SIGNING_PASSWORD }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,11 +15,16 @@ | |
*/ | ||
|
||
plugins { | ||
id 'java' | ||
id 'java-library' | ||
id 'application' | ||
id 'maven-publish' | ||
id 'signing' | ||
id 'com.palantir.docker' version '0.25.0' | ||
id 'org.jetbrains.kotlin.jvm' version '1.6.21' | ||
id "org.owasp.dependencycheck" version "7.4.4" | ||
id "io.github.gradle-nexus.publish-plugin" version "1.0.0" | ||
|
||
} | ||
|
||
group 'com.exactpro.th2' | ||
|
@@ -107,3 +112,113 @@ application { | |
dependencyCheck { | ||
formats=['SARIF'] | ||
} | ||
|
||
dependencyLocking { | ||
lockAllConfigurations() | ||
} | ||
|
||
|
||
java { | ||
withJavadocJar() | ||
withSourcesJar() | ||
} | ||
|
||
// conditionals for publications | ||
tasks.withType(PublishToMavenRepository) { | ||
onlyIf { | ||
(repository == publishing.repositories.nexusRepository && | ||
project.hasProperty('nexus_user') && | ||
project.hasProperty('nexus_password') && | ||
project.hasProperty('nexus_url')) || | ||
(repository == publishing.repositories.sonatype && | ||
project.hasProperty('sonatypeUsername') && | ||
project.hasProperty('sonatypePassword')) | ||
} | ||
} | ||
tasks.withType(Sign) { | ||
onlyIf { project.hasProperty('signingKey') && | ||
project.hasProperty('signingPassword') | ||
} | ||
} | ||
// disable running task 'initializeSonatypeStagingRepository' on a gitlab | ||
tasks.whenTaskAdded {task -> | ||
if(task.name.equals('initializeSonatypeStagingRepository') && | ||
!(project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')) | ||
) { | ||
task.enabled = false | ||
} | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
from(components.java) | ||
pom { | ||
name = rootProject.name | ||
packaging = 'jar' | ||
description = rootProject.description | ||
url = vcs_url | ||
scm { | ||
url = vcs_url | ||
} | ||
licenses { | ||
license { | ||
name = 'The Apache License, Version 2.0' | ||
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = 'developer' | ||
name = 'developer' | ||
email = '[email protected]' | ||
} | ||
} | ||
scm { | ||
url = vcs_url | ||
} | ||
} | ||
} | ||
} | ||
repositories { | ||
//Nexus repo to publish from gitlab | ||
maven { | ||
name = 'nexusRepository' | ||
credentials { | ||
username = project.findProperty('nexus_user') | ||
password = project.findProperty('nexus_password') | ||
} | ||
url = project.findProperty('nexus_url') | ||
} | ||
} | ||
} | ||
|
||
nexusPublishing { | ||
repositories { | ||
sonatype { | ||
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/")) | ||
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")) | ||
} | ||
} | ||
} | ||
|
||
|
||
signing { | ||
def signingKey = findProperty("signingKey") | ||
def signingPassword = findProperty("signingPassword") | ||
useInMemoryPgpKeys(signingKey, signingPassword) | ||
sign publishing.publications.mavenJava | ||
} | ||
|
||
test { | ||
useJUnitPlatform { | ||
excludeTags('integration-test') | ||
} | ||
} | ||
|
||
tasks.register('integrationTest', Test) { | ||
group = 'verification' | ||
useJUnitPlatform { | ||
includeTags('integration-test') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
release_version=3.5.1 | ||
release_version=3.5.2 | ||
vcs_url=https://github.com/th2-net/th2-read-log |