-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
8 changed files
with
160 additions
and
96 deletions.
There are no files selected for viewing
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,18 @@ | ||
name: Build and publish dev release jar to sonatype repository | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
build: | ||
uses: th2-net/.github/.github/workflows/compound-java.yml@main | ||
with: | ||
build-target: 'Sonatype,Docker' | ||
devRelease: true | ||
createTag: true | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Build and publish release jar to sonatype repository | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
build: | ||
uses: th2-net/.github/.github/workflows/compound-java.yml@main | ||
with: | ||
build-target: 'Sonatype,Docker' | ||
devRelease: false | ||
createTag: true | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Build and publish jar to sonatype snapshot repository | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- master | ||
- version-* | ||
- dependabot* | ||
paths-ignore: | ||
- README.md | ||
|
||
jobs: | ||
build-job: | ||
uses: th2-net/.github/.github/workflows/compound-java-dev.yml@main | ||
with: | ||
build-target: 'Sonatype,Docker' | ||
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
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 |
---|---|---|
|
@@ -21,11 +21,15 @@ plugins { | |
id 'java' | ||
id 'java-library' | ||
id 'application' | ||
id 'maven-publish' | ||
id "io.github.gradle-nexus.publish-plugin" version "1.3.0" | ||
id 'com.palantir.docker' version '0.34.0' | ||
id "org.owasp.dependencycheck" version "9.0.9" | ||
id "com.gorylenko.gradle-git-properties" version "2.4.1" | ||
id 'com.github.jk1.dependency-license-report' version '2.5' | ||
id "de.undercouch.download" version "5.4.0" | ||
id 'signing' | ||
id "com.google.protobuf" version "0.9.3" | ||
} | ||
|
||
group 'com.exactpro.th2' | ||
|
@@ -77,6 +81,98 @@ dependencies { | |
implementation "org.apache.commons:commons-csv:1.9.0" | ||
} | ||
|
||
java { | ||
withJavadocJar() | ||
withSourcesJar() | ||
} | ||
|
||
// conditionals for publications | ||
tasks.withType(PublishToMavenRepository).configureEach { | ||
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).configureEach { | ||
onlyIf { | ||
project.hasProperty('signingKey') && | ||
project.hasProperty('signingPassword') | ||
} | ||
} | ||
// disable running task 'initializeSonatypeStagingRepository' on a gitlab | ||
tasks.configureEach { task -> | ||
if (task.name == '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 { | ||
String signingKey = findProperty("signingKey") | ||
String signingPassword = findProperty("signingPassword") | ||
useInMemoryPgpKeys(signingKey, signingPassword) | ||
sign publishing.publications.mavenJava | ||
} | ||
|
||
applicationName = 'service' | ||
|
||
application { | ||
|
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,2 +1,4 @@ | ||
release_version = 5.0.0 | ||
docker_image_name = th2-hand | ||
docker_image_name = th2-hand | ||
|
||
vcs_url=https://github.com/th2-net/th2-hand |