Skip to content

Commit

Permalink
Merge branch 'release/v0.23.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
bia-tech committed Dec 18, 2023
2 parents 2b28846 + 20c5a3f commit d647462
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 6 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/publish-to-sonatype.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish to Sonatype

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

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'liberica'
- name: Publish to Sonatype
run: ./gradlew publishMavenPublicationToSonatypeRepository -PsimplifyVersion
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryPassword: ${{ secrets.GPG_SIGNING_PASSWORD }}
- name: Close repository
if: github.event_name == 'release'
run: ./gradlew closeAndReleaseRepository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_nexusUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_nexusPassword: ${{ secrets.SONATYPE_PASSWORD }}
47 changes: 45 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import me.qoomon.gitversioning.commons.GitRefType
import java.util.*

plugins {
Expand All @@ -6,9 +7,10 @@ plugins {
jacoco
`java-library`
antlr
signing
id("org.sonarqube") version "4.4.1.3373"
id("org.cadixdev.licenser") version "0.6.1"
id("com.github.gradle-git-version-calculator") version "1.1.0"
id("me.qoomon.git-versioning") version "6.4.3"
id("io.freefair.javadoc-links") version "8.4"
id("io.freefair.javadoc-utf-8") version "8.4"
id("com.github.ben-manes.versions") version "0.50.0"
Expand All @@ -22,7 +24,22 @@ repositories {
}

group = "io.github.1c-syntax"
version = gitVersionCalculator.calculateVersion("v")
gitVersioning.apply {
refs {
considerTagsOnBranches = true
tag("v(?<tagVersion>[0-9].*)") {
version = "\${ref.tagVersion}\${dirty}"
}
branch(".+") {
version = "\${ref}-\${commit.short}\${dirty}"
}
}

rev {
version = "\${commit.short}\${dirty}"
}
}
val isSnapshot = gitVersioning.gitVersionDetails.refType != GitRefType.TAG

val antlrVersion = "4.9.0"
val antlrGroupId = "com.tunnelvisionlabs"
Expand Down Expand Up @@ -183,7 +200,33 @@ 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
}
}
}
publications {
create<MavenPublication>("maven") {
from(components["java"])
Expand Down
4 changes: 0 additions & 4 deletions jitpack.yml

This file was deleted.

0 comments on commit d647462

Please sign in to comment.