Skip to content

Commit

Permalink
Merge pull request #40 from th2-net/release-version-fix
Browse files Browse the repository at this point in the history
sonatype publishing
  • Loading branch information
Xanclry authored Jan 31, 2023
2 parents 235e6ff + 0301463 commit 55bc1e8
Show file tree
Hide file tree
Showing 9 changed files with 163 additions and 176 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/dev-docker-publish.yml

This file was deleted.

66 changes: 0 additions & 66 deletions .github/workflows/dev-publish-release.yml

This file was deleted.

20 changes: 20 additions & 0 deletions .github/workflows/dev-publish.yml
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 }}
18 changes: 0 additions & 18 deletions .github/workflows/docker-publish.yml

This file was deleted.

74 changes: 0 additions & 74 deletions .github/workflows/publish-release.yml

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/release-publish.yml
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 }}
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Log Reader User Manual 3.5.1
# Log Reader User Manual 3.5.2

## Document Information

Expand Down Expand Up @@ -170,6 +170,10 @@ Output: 8=FIXT.1.1\u00019=66\u000135=A\u000134=1\u000149=NFT2_FIX1\u000156=FGW\u

## Changes

### 3.5.2

+ Fixed release version: removed `SNAPSHOT`

### 3.5.1

+ Fixed release workflow
Expand Down
115 changes: 115 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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')
}
}
3 changes: 2 additions & 1 deletion gradle.properties
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

0 comments on commit 55bc1e8

Please sign in to comment.