Skip to content
Merged
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
32 changes: 32 additions & 0 deletions .github/workflows/publish-to-maven-central.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish to maven central

on:
release:
types: [published]
push:
branches:
- develop
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK
uses: actions/setup-java@v5
with:
java-version: 17
distribution: 'temurin'
cache: gradle
- name: Deploy to Central Portal
run: |
./gradlew publishMavenPublicationToStagingRepository
./gradlew jreleaserDeploy
env:
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_SIGNING_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SIGNING_KEY }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_SIGNING_PASSWORD }}
37 changes: 0 additions & 37 deletions .github/workflows/publish-to-sonatype.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 46 additions & 31 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import me.qoomon.gitversioning.commons.GitRefType
import java.util.Calendar
import org.jreleaser.model.Active.*

plugins {
`java-library`
`maven-publish`
jacoco
signing
id("org.cadixdev.licenser") version "0.6.1"
id("me.qoomon.git-versioning") version "6.4.4"
id("com.gorylenko.gradle-git-properties") version "2.5.2"
id("io.freefair.lombok") version "8.11"
id("io.freefair.javadoc-links") version "8.11"
id("io.freefair.javadoc-utf-8") version "8.11"
id("io.freefair.maven-central.validate-poms") version "8.11"
id("io.freefair.lombok") version "8.14.2"
id("io.freefair.javadoc-links") version "8.14.2"
id("io.freefair.javadoc-utf-8") version "8.14.2"
id("io.freefair.maven-central.validate-poms") version "8.14.2"
id("com.github.ben-manes.versions") version "0.52.0"
id("ru.vyarus.pom") version "3.0.0"
id("io.codearte.nexus-staging") version "0.30.0"
id("org.jreleaser") version "1.19.0"
}

group = "io.github.1c-syntax"
Expand Down Expand Up @@ -108,31 +108,11 @@ artifacts {
archives(tasks["javadocJar"])
}

signing {
val signingInMemoryKey: String? by project // env.ORG_GRADLE_PROJECT_signingInMemoryKey
val signingInMemoryPassword: String? by project // env.ORG_GRADLE_PROJECT_signingInMemoryPassword
if (signingInMemoryKey != null) {
useInMemoryPgpKeys(signingInMemoryKey, signingInMemoryPassword)
sign(publishing.publications)
}
}

publishing {
repositories {
maven {
name = "sonatype"
url = if (isSnapshot)
uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
else
uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")

val sonatypeUsername: String? by project
val sonatypePassword: String? by project

credentials {
username = sonatypeUsername // ORG_GRADLE_PROJECT_sonatypeUsername
password = sonatypePassword // ORG_GRADLE_PROJECT_sonatypePassword
}
name = "staging"
url = layout.buildDirectory.dir("staging-deploy").get().asFile.toURI()
}
}
publications {
Expand Down Expand Up @@ -184,12 +164,47 @@ publishing {
developerConnection.set("scm:git:git@github.com:1c-syntax/utils.git")
url.set("https://github.com/1c-syntax/utils")
}
// Добавлено для Maven Central validation
issueManagement {
system.set("GitHub Issues")
url.set("https://github.com/1c-syntax/utils/issues")
}
// Добавлено для Maven Central validation
ciManagement {
system.set("GitHub Actions")
url.set("https://github.com/1c-syntax/utils/actions")
}
}
}
}
}

nexusStaging {
serverUrl = "https://s01.oss.sonatype.org/service/local/"
stagingProfileId = "15bd88b4d17915" // ./gradlew getStagingProfile
jreleaser {
signing {
active = ALWAYS
armored = true
}
deploy {
maven {
mavenCentral {
create("release-deploy") {
active = RELEASE
url = "https://central.sonatype.com/api/v1/publisher"
stagingRepository("build/staging-deploy")
}
}
nexus2 {
create("snapshot-deploy") {
active = SNAPSHOT
snapshotUrl = "https://central.sonatype.com/repository/maven-snapshots/"
applyMavenCentralRules = true
snapshotSupported = true
closeRepository = true
releaseRepository = true
stagingRepository("build/staging-deploy")
}
}
}
}
}

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
33 changes: 20 additions & 13 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 12 additions & 10 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading