Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/ci-workflow-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build and Publish Snapshot

on:
push:
branches-ignore:
- master
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: 11
distribution: liberica

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: wrapper

- name: Checkout repository
uses: actions/checkout@v4

- name: Prepare a tool to detect unwelcome words
uses: actions/checkout@v4
with:
repository: exactpro/ci-github-action
ref: master
token: ${{ secrets.PAT_CI_ACTION }}
path: ci-github-unwelcome-words-action

- name: Run CI action to detect unwelcome words
uses: ./ci-github-unwelcome-words-action
with:
ref: ${{ github.sha }}

- name: Build project and run tests
run: ./gradlew clean build

- name: Store test results
if: always()
uses: actions/upload-artifact@v4
with:
name: reports
path: |
**/build/reports/
**/build/test-results/

- name: Upload Archives
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_SECRET_KEY: ${{ secrets.SIGNING_SECRET_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
run: |
./gradlew closeAndReleaseStagingRepositories publish \
-Psigning.keyId=$SIGNING_KEY_ID \
-Psigning.secretKey=$SIGNING_SECRET_KEY \
-Psigning.password=$SIGNING_PASSWORD \
-PossrhUsername=$OSSRH_USERNAME \
-PossrhPassword=$OSSRH_PASSWORD
93 changes: 93 additions & 0 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Build and Publish Release Version

on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: 11
distribution: liberica

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: wrapper

- name: Checkout repository
uses: actions/checkout@v4

- name: Prepare a tool to detect unwelcome words
uses: actions/checkout@v4
with:
repository: exactpro/ci-github-action
ref: rm86256
token: ${{ secrets.PAT_CI_ACTION }}
path: ci-github-unwelcome-words-action

- name: Run CI action to detect unwelcome words
uses: ./ci-github-unwelcome-words-action
with:
ref: ${{ github.sha }}

- name: Build project and run tests
run: ./gradlew clean build -PreleaseMode

- name: Store test results
if: always()
uses: actions/upload-artifact@v4
with:
name: reports
path: |
**/build/reports/
**/build/test-results/

- name: Upload Archives
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_SECRET_KEY: ${{ secrets.SIGNING_SECRET_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
run: |
./gradlew closeAndReleaseStagingRepositories publish \
-PreleaseMode \
-Psigning.keyId=$SIGNING_KEY_ID \
-Psigning.secretKey=$SIGNING_SECRET_KEY \
-Psigning.password=$SIGNING_PASSWORD \
-PossrhUsername=$OSSRH_USERNAME \
-PossrhPassword=$OSSRH_PASSWORD

- name: Read version of the project
id: read_project_version
run: |
VERSION=$(./gradlew properties | grep -w "version" | cut -d ':' -f 2 | xargs)
echo "Version found: ${VERSION}"
echo "project_version=${VERSION}" >> $GITHUB_OUTPUT

- name: Create Tag
uses: actions/github-script@v5
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/v${{ steps.read_project_version.outputs.project_version }}",
sha: context.sha
})

- name: Create Github Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "v${{ steps.read_project_version.outputs.project_version }}"
release_name: "Release v${{ steps.read_project_version.outputs.project_version }}"
body: "Release of version ${{ steps.read_project_version.outputs.project_version }}"
draft: false
prerelease: false
135 changes: 82 additions & 53 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/******************************************************************************
* Copyright 2009-2018 Exactpro (Exactpro Systems Limited)
* Copyright 2009-2024 Exactpro (Exactpro Systems Limited)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,6 +14,11 @@
* limitations under the License.
******************************************************************************/

plugins {
id 'jacoco'
id "io.github.gradle-nexus.publish-plugin" version "2.0.0"
}

allprojects {
ext {
sharedDir = file("${project.rootDir}/shared")
Expand All @@ -22,8 +27,8 @@ allprojects {
genDir = file("${srcDir}/gen")
genJavaDir = file("${genDir}/java")

incremental_build = project.hasProperty('i') ? true : false
sonatype_publish = project.hasProperty('sonatypePublish') ? true : false
sonatype_publish = project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')
isReleaseMode = project.hasProperty('releaseMode')

// Set defaults
if (!project.hasProperty("revision")) {
Expand All @@ -38,36 +43,30 @@ allprojects {
//Lib versions
version_slf4j = '1.7.5'

exactproVersion = '12'
quickfixjVersionSuffix = (isReleaseMode)? '': '-SNAPSHOT'
quickfixjVersion = "${quickfixjPrefixVersion}.${exactproVersion}${quickfixjVersionSuffix}"
}
}

version = quickfixjVersion

subprojects {
apply plugin: 'eclipse'
apply plugin: 'jacoco'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'

if (sonatype_publish) {
apply plugin: 'signing'
}

group = 'com.exactpro.quickfixj'
version = "1.6.0.${exactproVersion}"
version = quickfixjVersion

sourceCompatibility = 1.7 //Java version compatibility to use when compiling Java source.
targetCompatibility = 1.7 //Java version to generate classes for.
sourceCompatibility = JavaVersion.VERSION_1_7 //Java version compatibility to use when compiling Java source.
targetCompatibility = JavaVersion.VERSION_1_7 //Java version to generate classes for.
compileJava.options.debugOptions.debugLevel = "source,lines,vars" // Include debug information

buildscript { // artifacrory plugin
repositories {
jcenter()
}
dependencies {
classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '2.2.+')
classpath(group: 'com.netflix.nebula', name: 'gradle-extra-configurations-plugin', version: '2.2.+')
}

configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
Expand All @@ -78,11 +77,11 @@ subprojects {
name 'MavenLocal' // for local builds only
url sharedDir
}
jcenter()
mavenCentral()
}

configurations {
compile.exclude module: 'avalon-framework-api'
implementation.exclude module: 'avalon-framework-api'

all {
transitive = true
Expand Down Expand Up @@ -127,66 +126,90 @@ subprojects {
}
}

uploadArchives {
repositories {
mavenDeployer {
if (sonatype_publish) {
beforeDeployment {
MavenDeployment deployment -> signing.signPom(deployment)
}

repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}

snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java

pom.project {
name 'Exactpro QuickFixJ'
if (sonatype_publish) {
pom {
name = 'Exactpro QuickFixJ'
packaging 'jar'
// optionally artifactId can be defined here
description 'QuickFixJ is one of such libraries we depend on and which was modified by Exactpro.'
url 'https://github.com/Exactpro/quickfixj'
url = vcsUrl

scm {
connection 'scm:git:https://github.com/Exactpro/quickfixj'
developerConnection 'scm:git:https://github.com/Exactpro/quickfixj'
url 'https://github.com/Exactpro/quickfixj'
connection = 'scm:git:https://github.com/Exactpro/quickfixj'
developerConnection = 'scm:git:https://github.com/Exactpro/quickfixj'
url = vcsUrl
}

licenses {
license {
name 'The Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}

developers {
developer {
id 'Nikita-Smirnov-Exactpro'
name 'Nikita Smirnov'
email 'nikita.smirnov@exactprosystems.com'
id.set('sf_devs')
name.set('sf_devs')
email.set('sf_devs@exactpro.com')
}
}
}
} else {
// uniqueVersion = false // publish non unique snapshots to local repository
repository(url: "file://${sharedDir}")
}
}
}
doFirst { sharedDir.mkdirs() }

repositories {
if (sonatype_publish) {
maven {
url = sonatypeUrl
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
maven {
url = sonatypeSnapshotsUrl
credentials {
username = ossrhUsername
password = ossrhPassword
}
}
} else {
// uniqueVersion = false // publish non unique snapshots to local repository
sharedDir.mkdirs()
maven {
url = "file://${sharedDir}"
}
}
}
}

task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
if(sonatype_publish) {
nexusPublishing {
repositories {
sonatype {
nexusUrl = uri(sonatypeUrl)
snapshotRepositoryUrl = uri(sonatypeSnapshotsUrl)
}
}
}
}

tasks.register('sourcesJar', Jar) {
dependsOn classes
archiveClassifier = 'sources'
from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: classes) {
classifier = 'javadoc'
tasks.register('javadocJar', Jar) {
dependsOn classes
archiveClassifier = 'javadoc'
from javadoc
}

Expand All @@ -195,6 +218,12 @@ subprojects {
}

if (sonatype_publish) {
tasks.withType(Sign).configureEach {
onlyIf {
project.hasProperty('signing.keyId') && project.hasProperty('signing.password')
}
}

signing {
sign configurations.archives
}
Expand Down
Loading