Skip to content

Commit ac011a0

Browse files
committed
Finish v0.15.1
2 parents 06aed2c + a1281ac commit ac011a0

File tree

5 files changed

+100
-84
lines changed

5 files changed

+100
-84
lines changed

.github/workflows/check.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
with:
2323
submodules: true
2424
lfs: true
25+
fetch-depth: 0
2526
- name: Set up JDK ${{ matrix.java_version }}
2627
uses: actions/setup-java@v5
2728
with:

.github/workflows/gh-pages.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
with:
2121
submodules: true
2222
lfs: true
23+
fetch-depth: 0
2324

2425
- name: Setup JDK
2526
uses: actions/setup-java@v5
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Publish to maven central
2+
3+
on:
4+
release:
5+
types: [published]
6+
push:
7+
branches:
8+
- develop
9+
workflow_dispatch:
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v5
16+
with:
17+
fetch-depth: 0
18+
- name: Set up JDK
19+
uses: actions/setup-java@v5
20+
with:
21+
java-version: 17
22+
distribution: 'temurin'
23+
cache: gradle
24+
- name: Deploy to Central Portal
25+
run: |
26+
./gradlew publishMavenPublicationToStagingRepository
27+
./gradlew jreleaserDeploy
28+
env:
29+
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
31+
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
32+
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_SIGNING_PUBLIC_KEY }}
33+
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SIGNING_KEY }}
34+
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_SIGNING_PASSWORD }}
35+
JRELEASER_DEPLOY_MAVEN_NEXUS2_SNAPSHOT_DEPLOY_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
36+
JRELEASER_DEPLOY_MAVEN_NEXUS2_SNAPSHOT_DEPLOY_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}

.github/workflows/publish-to-sonatype.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

build.gradle.kts

Lines changed: 62 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,36 @@
1-
import me.qoomon.gitversioning.commons.GitRefType
2-
import java.util.*
1+
import java.util.Calendar
2+
import org.jreleaser.model.Active.*
33

44
plugins {
55
`java-library`
66
`maven-publish`
77
jacoco
8-
signing
98
id("org.cadixdev.licenser") version "0.6.1"
109
id("me.qoomon.git-versioning") version "6.4.4"
11-
id("com.gorylenko.gradle-git-properties") version "2.5.0"
12-
id("io.freefair.lombok") version "8.14"
13-
id("io.freefair.javadoc-links") version "8.14"
14-
id("io.freefair.javadoc-utf-8") version "8.14"
15-
id("io.freefair.maven-central.validate-poms") version "8.14"
10+
id("io.freefair.lombok") version "8.14.2"
11+
id("io.freefair.javadoc-links") version "8.14.2"
12+
id("io.freefair.javadoc-utf-8") version "8.14.2"
13+
id("io.freefair.maven-central.validate-poms") version "8.14.2"
14+
id("com.github.ben-manes.versions") version "0.52.0"
1615
id("ru.vyarus.pom") version "3.0.0"
16+
id("org.jreleaser") version "1.19.0"
1717
id("org.sonarqube") version "6.2.0.5505"
18-
id("io.codearte.nexus-staging") version "0.30.0"
1918
}
2019

2120
group = "io.github.1c-syntax"
2221
gitVersioning.apply {
2322
refs {
24-
considerTagsOnBranches = true
23+
describeTagFirstParent = false
2524
tag("v(?<tagVersion>[0-9].*)") {
2625
version = "\${ref.tagVersion}\${dirty}"
2726
}
27+
28+
branch("develop") {
29+
version = "\${describe.tag.version.major}." +
30+
"\${describe.tag.version.minor.next}.0." +
31+
"\${describe.distance}-SNAPSHOT\${dirty}"
32+
}
33+
2834
branch(".+") {
2935
version = "\${ref}-\${commit.short}\${dirty}"
3036
}
@@ -34,12 +40,10 @@ gitVersioning.apply {
3440
version = "\${commit.short}\${dirty}"
3541
}
3642
}
37-
val isSnapshot = gitVersioning.gitVersionDetails.refType != GitRefType.TAG
3843

3944
repositories {
4045
mavenLocal()
4146
mavenCentral()
42-
maven(url = "https://s01.oss.sonatype.org/content/repositories/snapshots/")
4347
}
4448

4549
dependencies {
@@ -53,9 +57,9 @@ dependencies {
5357

5458
// прочее
5559
implementation("commons-io", "commons-io", "2.18.0")
56-
implementation("io.github.1c-syntax", "utils", "0.6.2")
57-
implementation("io.github.1c-syntax", "bsl-common-library", "0.8.0")
58-
implementation("io.github.1c-syntax", "supportconf", "0.14.2")
60+
implementation("io.github.1c-syntax", "utils", "0.6.3")
61+
implementation("io.github.1c-syntax", "bsl-common-library", "0.8.1")
62+
implementation("io.github.1c-syntax", "supportconf", "0.14.3")
5963

6064
// быстрый поиск классов
6165
implementation("io.github.classgraph", "classgraph", "4.8.179")
@@ -105,7 +109,7 @@ tasks.check {
105109
tasks.jacocoTestReport {
106110
reports {
107111
xml.required.set(true)
108-
xml.outputLocation.set(File("$buildDir/reports/jacoco/test/jacoco.xml"))
112+
xml.outputLocation.set(layout.buildDirectory.file("reports/jacoco/test/jacoco.xml"))
109113
}
110114
}
111115

@@ -134,7 +138,7 @@ sonar {
134138
property("sonar.projectKey", "1c-syntax_mdclasses")
135139
property("sonar.projectName", "MDClasses")
136140
property("sonar.exclusions", "**/resources/**/*.*")
137-
property("sonar.coverage.jacoco.xmlReportPaths", "$buildDir/reports/jacoco/test/jacoco.xml")
141+
property("sonar.coverage.jacoco.xmlReportPaths", "${layout.buildDirectory.get()}/reports/jacoco/test/jacoco.xml")
138142
}
139143
}
140144

@@ -161,41 +165,18 @@ license {
161165
exclude("**/*.orig")
162166
}
163167

164-
signing {
165-
val signingInMemoryKey: String? by project // env.ORG_GRADLE_PROJECT_signingInMemoryKey
166-
val signingInMemoryPassword: String? by project // env.ORG_GRADLE_PROJECT_signingInMemoryPassword
167-
if (signingInMemoryKey != null) {
168-
useInMemoryPgpKeys(signingInMemoryKey, signingInMemoryPassword)
169-
sign(publishing.publications)
170-
}
171-
}
172168

173169
publishing {
174170
repositories {
175171
maven {
176-
name = "sonatype"
177-
url = if (isSnapshot)
178-
uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
179-
else
180-
uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
181-
182-
val sonatypeUsername: String? by project
183-
val sonatypePassword: String? by project
184-
185-
credentials {
186-
username = sonatypeUsername // ORG_GRADLE_PROJECT_sonatypeUsername
187-
password = sonatypePassword // ORG_GRADLE_PROJECT_sonatypePassword
188-
}
172+
name = "staging"
173+
url = layout.buildDirectory.dir("staging-deploy").get().asFile.toURI()
189174
}
190175
}
191176
publications {
192177
create<MavenPublication>("maven") {
193178
from(components["java"])
194179

195-
if (isSnapshot && project.hasProperty("simplifyVersion")) {
196-
version = findProperty("git.ref.slug") as String + "-SNAPSHOT"
197-
}
198-
199180
pom {
200181
description.set("Metadata read/write library for Language 1C (BSL)")
201182
url.set("https://github.com/1c-syntax/mdclasses")
@@ -229,19 +210,53 @@ publishing {
229210
developerConnection.set("scm:git:[email protected]:1c-syntax/mdclasses.git")
230211
url.set("https://github.com/1c-syntax/mdclasses")
231212
}
213+
// Добавлено для Maven Central validation
214+
issueManagement {
215+
system.set("GitHub Issues")
216+
url.set("https://github.com/1c-syntax/mdclasses/issues")
217+
}
218+
// Добавлено для Maven Central validation
219+
ciManagement {
220+
system.set("GitHub Actions")
221+
url.set("https://github.com/1c-syntax/mdclasses/actions")
222+
}
232223
}
233224
}
234225
}
235226
}
236227

237-
nexusStaging {
238-
serverUrl = "https://s01.oss.sonatype.org/service/local/"
239-
stagingProfileId = "15bd88b4d17915" // ./gradlew getStagingProfile
240-
}
241-
242228
tasks.register("precommit") {
243229
description = "Run all precommit tasks"
244230
group = "Developer tools"
245231
dependsOn(":test")
246232
dependsOn(":updateLicenses")
247233
}
234+
235+
jreleaser {
236+
signing {
237+
active = ALWAYS
238+
armored = true
239+
}
240+
deploy {
241+
maven {
242+
mavenCentral {
243+
create("release-deploy") {
244+
active = RELEASE
245+
url = "https://central.sonatype.com/api/v1/publisher"
246+
stagingRepository("build/staging-deploy")
247+
}
248+
}
249+
nexus2 {
250+
create("snapshot-deploy") {
251+
active = SNAPSHOT
252+
snapshotUrl = "https://central.sonatype.com/repository/maven-snapshots/"
253+
applyMavenCentralRules = true
254+
snapshotSupported = true
255+
closeRepository = true
256+
releaseRepository = true
257+
stagingRepository("build/staging-deploy")
258+
}
259+
}
260+
}
261+
}
262+
}

0 commit comments

Comments
 (0)