Skip to content

Commit e02137e

Browse files
committed
Finish v0.1.2
2 parents 17e1456 + 5d8a96b commit e02137e

File tree

11 files changed

+104
-86
lines changed

11 files changed

+104
-86
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ jobs:
1111
java_version: ['17', '21']
1212
os: [ubuntu-latest, windows-latest, macOS-latest]
1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v5
15+
with:
16+
fetch-depth: 0
1517
- name: Set up JDK ${{ matrix.java_version }}
16-
uses: actions/setup-java@v4
18+
uses: actions/setup-java@v5
1719
with:
1820
java-version: ${{ matrix.java_version }}
1921
distribution: 'adopt'
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.

.github/workflows/qa.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ jobs:
1212
runs-on: ubuntu-latest
1313
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.event.repository.full_name
1414
steps:
15-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v5
1616
with:
1717
fetch-depth: ''
1818
- run: |
1919
git fetch --prune --unshallow
2020
- name: Set up JDK 17
21-
uses: actions/setup-java@v4
21+
uses: actions/setup-java@v5
2222
with:
2323
java-version: 17
2424
distribution: 'adopt'

.github/workflows/update-gradle.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v4
13+
- uses: actions/checkout@v5
1414

1515
- name: Set up JDK 17
16-
uses: actions/setup-java@v4
16+
uses: actions/setup-java@v5
1717
with:
1818
java-version: 17
1919
distribution: 'temurin'

.idea/compiler.xml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle.kts

Lines changed: 51 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,35 @@
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
9-
id("org.sonarqube") version "6.0.1.5171"
108
id("org.cadixdev.licenser") version "0.6.1"
119
id("me.qoomon.git-versioning") version "6.4.4"
12-
id("io.codearte.nexus-staging") version "0.30.0"
10+
id("org.jreleaser") version "1.19.0"
11+
id("org.sonarqube") version "6.2.0.5505"
1312
}
1413

1514
repositories {
1615
mavenLocal()
1716
mavenCentral()
18-
maven(url = "https://s01.oss.sonatype.org/content/repositories/snapshots")
1917
}
2018

2119
group = "io.github.1c-syntax"
2220
gitVersioning.apply {
2321
refs {
24-
considerTagsOnBranches = true
22+
describeTagFirstParent = false
2523
tag("v(?<tagVersion>[0-9].*)") {
2624
version = "\${ref.tagVersion}\${dirty}"
2725
}
26+
27+
branch("develop") {
28+
version = "\${describe.tag.version.major}." +
29+
"\${describe.tag.version.minor.next}.0." +
30+
"\${describe.distance}-SNAPSHOT\${dirty}"
31+
}
32+
2833
branch(".+") {
2934
version = "\${ref}-\${commit.short}\${dirty}"
3035
}
@@ -34,7 +39,6 @@ gitVersioning.apply {
3439
version = "\${commit.short}\${dirty}"
3540
}
3641
}
37-
val isSnapshot = gitVersioning.gitVersionDetails.refType != GitRefType.TAG
3842

3943
dependencies {
4044
api("org.antlr", "antlr-runtime", "3.5.3")
@@ -125,41 +129,19 @@ artifacts {
125129
archives(tasks["javadocJar"])
126130
}
127131

128-
signing {
129-
val signingInMemoryKey: String? by project // env.ORG_GRADLE_PROJECT_signingInMemoryKey
130-
val signingInMemoryPassword: String? by project // env.ORG_GRADLE_PROJECT_signingInMemoryPassword
131-
if (signingInMemoryKey != null) {
132-
useInMemoryPgpKeys(signingInMemoryKey, signingInMemoryPassword)
133-
sign(publishing.publications)
134-
}
135-
}
136-
137132
publishing {
138133
repositories {
139134
maven {
140-
name = "sonatype"
141-
url = if (isSnapshot)
142-
uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
143-
else
144-
uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
145-
146-
val sonatypeUsername: String? by project
147-
val sonatypePassword: String? by project
148-
149-
credentials {
150-
username = sonatypeUsername // ORG_GRADLE_PROJECT_sonatypeUsername
151-
password = sonatypePassword // ORG_GRADLE_PROJECT_sonatypePassword
152-
}
135+
name = "staging"
136+
url = layout.buildDirectory.dir("staging-deploy").get().asFile.toURI()
153137
}
154138
}
155139
publications {
156140
create<MavenPublication>("maven") {
157141
from(components["java"])
158-
if (isSnapshot && project.hasProperty("simplifyVersion")) {
159-
version = findProperty("git.ref.slug") as String + "-SNAPSHOT"
160-
}
161142

162143
pom {
144+
name.set(project.name)
163145
description.set("ANTLR4 special fork")
164146
url.set("https://github.com/1c-syntax/antlr")
165147
licenses {
@@ -184,12 +166,44 @@ publishing {
184166
developerConnection.set("scm:git:[email protected]:1c-syntax/antlr.git")
185167
url.set("https://github.com/1c-syntax/antlr")
186168
}
169+
issueManagement {
170+
system.set("GitHub Issues")
171+
url.set("https://github.com/1c-syntax/antlr/issues")
172+
}
173+
ciManagement {
174+
system.set("GitHub Actions")
175+
url.set("https://github.com/1c-syntax/antlr/actions")
176+
}
187177
}
188178
}
189179
}
190180
}
191181

192-
nexusStaging {
193-
serverUrl = "https://s01.oss.sonatype.org/service/local/"
194-
stagingProfileId = "15bd88b4d17915" // ./gradlew getStagingProfile
195-
}
182+
jreleaser {
183+
signing {
184+
active = ALWAYS
185+
armored = true
186+
}
187+
deploy {
188+
maven {
189+
mavenCentral {
190+
create("release-deploy") {
191+
active = RELEASE
192+
url = "https://central.sonatype.com/api/v1/publisher"
193+
stagingRepository("build/staging-deploy")
194+
}
195+
}
196+
nexus2 {
197+
create("snapshot-deploy") {
198+
active = SNAPSHOT
199+
snapshotUrl = "https://central.sonatype.com/repository/maven-snapshots/"
200+
applyMavenCentralRules = true
201+
snapshotSupported = true
202+
closeRepository = true
203+
releaseRepository = true
204+
stagingRepository("build/staging-deploy")
205+
}
206+
}
207+
}
208+
}
209+
}

gradle/wrapper/gradle-wrapper.jar

181 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ case "$( uname )" in #(
114114
NONSTOP* ) nonstop=true ;;
115115
esac
116116

117-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
117+
CLASSPATH="\\\"\\\""
118118

119119

120120
# Determine the Java command to use to start the JVM.
@@ -205,15 +205,15 @@ fi
205205
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
206206

207207
# Collect all arguments for the java command:
208-
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
208+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
209209
# and any embedded shellness will be escaped.
210210
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
211211
# treated as '${Hostname}' itself on the command line.
212212

213213
set -- \
214214
"-Dorg.gradle.appname=$APP_BASE_NAME" \
215215
-classpath "$CLASSPATH" \
216-
org.gradle.wrapper.GradleWrapperMain \
216+
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
217217
"$@"
218218

219219
# Stop when "xargs" is not available.

0 commit comments

Comments
 (0)