Skip to content

Commit 2961aa2

Browse files
[RM] Support #86256. Migrated CI to GitHub workflow
1 parent d6dac5a commit 2961aa2

File tree

6 files changed

+175
-68
lines changed

6 files changed

+175
-68
lines changed

.github/workflows/ci-workflow.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Build and Publish Release Version
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Set up JDK 11
12+
uses: actions/setup-java@v4
13+
with:
14+
java-version: 11
15+
distribution: liberica
16+
17+
- name: Setup Gradle
18+
uses: gradle/actions/setup-gradle@v3
19+
with:
20+
gradle-version: wrapper
21+
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Build project and run tests
26+
run: ./gradlew clean build
27+
28+
- name: Store test results
29+
if: always()
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: reports
33+
path: |
34+
**/build/reports/
35+
**/build/test-results/
36+
37+
- name: Upload archives
38+
env:
39+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
40+
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
41+
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
42+
SIGNING_SECRET_KEY: ${{ secrets.SIGNING_SECRET_KEY }}
43+
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
44+
run: |
45+
./gradlew publish \
46+
-Psigning.keyId=$SIGNING_KEY_ID \
47+
-Psigning.secretKey=$SIGNING_SECRET_KEY \
48+
-Psigning.password=$SIGNING_PASSWORD \
49+
-PossrhUsername=$OSSRH_USERNAME \
50+
-PossrhPassword=$OSSRH_PASSWORD
51+
52+
- name: Read version of the project
53+
id: read_project_version
54+
run: |
55+
VERSION=$(./gradlew properties | grep -w "version" | cut -d ':' -f 2 | xargs)
56+
echo "Version found: ${VERSION}"
57+
echo "project_version=${VERSION}" >> $GITHUB_OUTPUT
58+
59+
- name: Create Tag
60+
uses: actions/github-script@v5
61+
with:
62+
script: |
63+
github.rest.git.createRef({
64+
owner: context.repo.owner,
65+
repo: context.repo.repo,
66+
ref: "refs/tags/v${{ steps.read_project_version.outputs.project_version }}",
67+
sha: context.sha
68+
})
69+
70+
- name: Create Github Release
71+
uses: actions/create-release@v1
72+
env:
73+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74+
with:
75+
tag_name: "v${{ steps.read_project_version.outputs.project_version }}"
76+
release_name: "Release v${{ steps.read_project_version.outputs.project_version }}"
77+
body: "Release of version ${{ steps.read_project_version.outputs.project_version }}"
78+
draft: false
79+
prerelease: false

build.gradle

Lines changed: 71 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/******************************************************************************
2-
* Copyright 2009-2018 Exactpro (Exactpro Systems Limited)
2+
* Copyright 2009-2024 Exactpro (Exactpro Systems Limited)
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,6 +14,10 @@
1414
* limitations under the License.
1515
******************************************************************************/
1616

17+
plugins {
18+
id 'jacoco'
19+
}
20+
1721
allprojects {
1822
ext {
1923
sharedDir = file("${project.rootDir}/shared")
@@ -22,8 +26,8 @@ allprojects {
2226
genDir = file("${srcDir}/gen")
2327
genJavaDir = file("${genDir}/java")
2428

25-
incremental_build = project.hasProperty('i') ? true : false
26-
sonatype_publish = project.hasProperty('sonatypePublish') ? true : false
29+
incremental_build = project.hasProperty('i')
30+
sonatype_publish = project.hasProperty('ossrhUsername') && project.hasProperty('ossrhPassword')
2731

2832
// Set defaults
2933
if (!project.hasProperty("revision")) {
@@ -37,34 +41,33 @@ allprojects {
3741
}
3842
//Lib versions
3943
version_slf4j = '1.7.5'
40-
41-
exactproVersion = '12'
4244
}
4345
}
4446

47+
version = "${quickfixjPrefixVersion}.${exactproVersion}"
48+
4549
subprojects {
4650
apply plugin: 'eclipse'
47-
apply plugin: 'jacoco'
4851
apply plugin: 'java'
49-
apply plugin: 'maven'
52+
apply plugin: 'maven-publish'
5053

5154
if (sonatype_publish) {
5255
apply plugin: 'signing'
5356
}
5457

5558
group = 'com.exactpro.quickfixj'
56-
version = "1.6.0.${exactproVersion}"
5759

58-
sourceCompatibility = 1.7 //Java version compatibility to use when compiling Java source.
59-
targetCompatibility = 1.7 //Java version to generate classes for.
60+
sourceCompatibility = JavaVersion.VERSION_1_7 //Java version compatibility to use when compiling Java source.
61+
targetCompatibility = JavaVersion.VERSION_1_7 //Java version to generate classes for.
6062
compileJava.options.debugOptions.debugLevel = "source,lines,vars" // Include debug information
6163

6264
buildscript { // artifacrory plugin
6365
repositories {
64-
jcenter()
66+
mavenCentral()
67+
gradlePluginPortal()
6568
}
6669
dependencies {
67-
classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '2.2.+')
70+
classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '4.4.12')
6871
classpath(group: 'com.netflix.nebula', name: 'gradle-extra-configurations-plugin', version: '2.2.+')
6972
}
7073

@@ -78,11 +81,12 @@ subprojects {
7881
name 'MavenLocal' // for local builds only
7982
url sharedDir
8083
}
81-
jcenter()
84+
mavenCentral()
85+
gradlePluginPortal()
8286
}
8387

8488
configurations {
85-
compile.exclude module: 'avalon-framework-api'
89+
implementation.exclude module: 'avalon-framework-api'
8690

8791
all {
8892
transitive = true
@@ -127,66 +131,79 @@ subprojects {
127131
}
128132
}
129133

130-
uploadArchives {
131-
repositories {
132-
mavenDeployer {
133-
if (sonatype_publish) {
134-
beforeDeployment {
135-
MavenDeployment deployment -> signing.signPom(deployment)
136-
}
137-
138-
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2") {
139-
authentication(userName: ossrhUsername, password: ossrhPassword)
140-
}
141-
142-
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots") {
143-
authentication(userName: ossrhUsername, password: ossrhPassword)
144-
}
134+
publishing {
135+
publications {
136+
mavenJava(MavenPublication) {
137+
from components.java
145138

146-
pom.project {
147-
name 'Exactpro QuickFixJ'
139+
if (sonatype_publish) {
140+
pom {
141+
name = 'Exactpro QuickFixJ'
148142
packaging 'jar'
149143
// optionally artifactId can be defined here
150144
description 'QuickFixJ is one of such libraries we depend on and which was modified by Exactpro.'
151-
url 'https://github.com/Exactpro/quickfixj'
145+
url = vcsUrl
152146

153147
scm {
154-
connection 'scm:git:https://github.com/Exactpro/quickfixj'
155-
developerConnection 'scm:git:https://github.com/Exactpro/quickfixj'
156-
url 'https://github.com/Exactpro/quickfixj'
148+
connection = 'scm:git:https://github.com/Exactpro/quickfixj'
149+
developerConnection = 'scm:git:https://github.com/Exactpro/quickfixj'
150+
url = vcsUrl
157151
}
158152

159153
licenses {
160154
license {
161-
name 'The Apache License, Version 2.0'
162-
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
155+
name = 'The Apache License, Version 2.0'
156+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
163157
}
164158
}
165159

166160
developers {
167161
developer {
168-
id 'Nikita-Smirnov-Exactpro'
169-
name 'Nikita Smirnov'
170-
email 'nikita.smirnov@exactprosystems.com'
162+
id = 'Nikita-Smirnov-Exactpro'
163+
name = 'Nikita Smirnov'
164+
email = 'nikita.smirnov@exactprosystems.com'
171165
}
172166
}
173167
}
174-
} else {
175-
// uniqueVersion = false // publish non unique snapshots to local repository
176-
repository(url: "file://${sharedDir}")
177168
}
178169
}
179170
}
180-
doFirst { sharedDir.mkdirs() }
171+
172+
repositories {
173+
if (sonatype_publish) {
174+
maven {
175+
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
176+
credentials {
177+
username = ossrhUsername
178+
password = ossrhPassword
179+
}
180+
}
181+
maven {
182+
url = "https://oss.sonatype.org/content/repositories/snapshots"
183+
credentials {
184+
username = ossrhUsername
185+
password = ossrhPassword
186+
}
187+
}
188+
} else {
189+
// uniqueVersion = false // publish non unique snapshots to local repository
190+
sharedDir.mkdirs()
191+
maven {
192+
url = "file://${sharedDir}"
193+
}
194+
}
195+
}
181196
}
182197

183-
task sourcesJar(type: Jar, dependsOn: classes) {
184-
classifier = 'sources'
198+
tasks.register('sourcesJar', Jar) {
199+
dependsOn classes
200+
archiveClassifier = 'sources'
185201
from sourceSets.main.allSource
186202
}
187203

188-
task javadocJar(type: Jar, dependsOn: classes) {
189-
classifier = 'javadoc'
204+
tasks.register('javadocJar', Jar) {
205+
dependsOn classes
206+
archiveClassifier = 'javadoc'
190207
from javadoc
191208
}
192209

@@ -195,6 +212,12 @@ subprojects {
195212
}
196213

197214
if (sonatype_publish) {
215+
tasks.withType(Sign).configureEach {
216+
onlyIf {
217+
project.hasProperty('signing.keyId') && project.hasProperty('signing.password')
218+
}
219+
}
220+
198221
signing {
199222
sign configurations.archives
200223
}

gradle.properties

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#/******************************************************************************
2-
#* Copyright 2009-2018 Exactpro (Exactpro Systems Limited)
2+
#* Copyright 2009-2024 Exactpro (Exactpro Systems Limited)
33
#*
44
#* Licensed under the Apache License, Version 2.0 (the "License");
55
#* you may not use this file except in compliance with the License.
@@ -14,5 +14,10 @@
1414
#* limitations under the License.
1515
#******************************************************************************/
1616

17-
org.gradle.daemon true
18-
org.gradle.daemon.idletimeout 10000
17+
org.gradle.daemon=true
18+
org.gradle.daemon.idletimeout=10000
19+
20+
quickfixjPrefixVersion=1.6.0
21+
exactproVersion=12
22+
23+
vcsUrl=https://github.com/Exactpro/quickfixj

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-bin.zip

quickfixj-codegenerator/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
******************************************************************************/
1616

17-
apply plugin: 'artifactory'
17+
apply plugin: 'com.jfrog.artifactory'
1818

1919
archivesBaseName = 'quickfixj-code-generator'
2020

quickfixj-core/build.gradle

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* limitations under the License.
1515
******************************************************************************/
1616

17-
apply plugin: 'artifactory'
18-
apply plugin: 'provided-base'
17+
apply plugin: 'com.jfrog.artifactory'
18+
// apply plugin: 'provided-base'
1919

2020
ext {
2121
dictDir = file('src/main/dicts')
@@ -39,24 +39,24 @@ sourceSets {
3939

4040
dependencies {
4141
if (incremental_build) {
42-
compile 'com.exactpro.quickfixj:quickfixj-code-generator:1.6.0.1-SNAPSHOT'
42+
implementation 'com.exactpro.quickfixj:quickfixj-code-generator:1.6.0.1-SNAPSHOT'
4343
} else {
44-
compile project(':quickfixj-codegenerator')
44+
implementation project(':quickfixj-codegenerator')
4545
}
4646

47-
compile 'com.exactpro.mina:apache-mina-core:2.0.9.1'
47+
implementation 'com.exactpro.mina:apache-mina-core:2.0.9.1'
4848

49-
compile "org.slf4j:slf4j-api:${version_slf4j}"
49+
implementation "org.slf4j:slf4j-api:${version_slf4j}"
5050

51-
compile 'com.cloudhopper.proxool:proxool:0.9.1'
51+
implementation 'com.cloudhopper.proxool:proxool:0.9.1'
5252

53-
testCompile 'junit:junit:4.10'
54-
testCompile 'org.mockito:mockito-all:1.10.19'
55-
testCompile 'org.mockito:mockito-core:1.10.19'
56-
testCompile 'org.hamcrest:hamcrest-all:1.1'
57-
testCompile 'hsqldb:hsqldb:1.8.0.10'
58-
testCompile 'tyrex:tyrex:1.0.1'
59-
testCompile "org.slf4j:slf4j-jdk14:${version_slf4j}"
53+
testImplementation 'junit:junit:4.10'
54+
testImplementation 'org.mockito:mockito-all:1.10.19'
55+
testImplementation 'org.mockito:mockito-core:1.10.19'
56+
testImplementation 'org.hamcrest:hamcrest-all:1.1'
57+
testImplementation 'hsqldb:hsqldb:1.8.0.10'
58+
testImplementation 'tyrex:tyrex:1.0.1'
59+
testImplementation "org.slf4j:slf4j-jdk14:${version_slf4j}"
6060
}
6161

6262
task generateMessage {
@@ -94,5 +94,5 @@ test {
9494
/*afterTest { desc, result ->
9595
println "Executing test ${desc.name} [${desc.className}] with result: ${result.resultType}. Time: ${(result.endTime - result.startTime)/1000}s"
9696
}*/
97-
testLogging.showStandardStreams = true
97+
// testLogging.showStandardStreams = true
9898
}

0 commit comments

Comments
 (0)