-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
86 lines (76 loc) · 2.27 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
plugins {
alias libs.plugins.mdg apply false
alias libs.plugins.managedversioning
alias libs.plugins.architectury.loom apply false
alias libs.plugins.registrationutils apply false
alias libs.plugins.nexuspublish
alias libs.plugins.idea.ext
}
managedVersioning {
versionFile.set rootProject.file('version.properties')
gitHubActions {
register('release') {
prettyName = 'Release'
workflowDispatch = true
gradleJob {
name = 'build'
javaVersion = '21'
step {
setupGitUser()
}
readOnly = false
gradlew 'Tag Release', 'tagRelease'
gradlew 'Build', 'build'
step {
run = 'git push && git push --tags'
}
recordVersion 'Record Version', 'version'
}
gradleJob {
name.set 'publish'
javaVersion = '21'
needs.add('build')
readOnly = false
gradlew 'Publish', 'publish', 'closeAndReleaseSonatypeStagingRepository'
tag.set('${{needs.build.outputs.version}}')
secrets 'GPG_SIGNING_KEY', 'GPG_KEY_PASSWORD', 'CENTRAL_MAVEN_USER', 'CENTRAL_MAVEN_PASSWORD'
}
}
}
apply()
}
println "Building: $version"
nexusPublishing {
repositories {
sonatype {
nexusUrl = uri('https://s01.oss.sonatype.org/service/local/')
username = System.getenv('CENTRAL_MAVEN_USER') ?: ''
password = System.getenv('CENTRAL_MAVEN_PASSWORD') ?: ''
}
}
}
configurations {
license {
canBeResolved = false
canBeConsumed = true
}
}
artifacts {
add 'license', file("LICENSE")
}
subprojects { p ->
apply plugin: 'maven-publish'
apply plugin: 'java-library'
apply plugin: libs.plugins.registrationutils.get().pluginId
registrationUtils {
group 'org.groovymc.cgl.reg'
}
jar {
manifest {
attributes([
'Implementation-Commit-Time': managedVersioning.timestamp.get(),
'Implementation-Commit': managedVersioning.hash.get()
])
}
}
}