Skip to content

Commit bf34331

Browse files
authored
Merge pull request #3 from rundeck-plugins/grails7-upgrade
Grails 7 Migration - Rundeck 6.0 Compatibility
2 parents dfed29c + 8f18c2d commit bf34331

7 files changed

Lines changed: 179 additions & 34 deletions

File tree

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
on:
2+
push:
3+
tags:
4+
- '*.*.*'
5+
6+
name: Publish Release
7+
8+
jobs:
9+
build:
10+
name: Publish Release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
- name: Set up JDK 17
18+
uses: actions/setup-java@v4
19+
with:
20+
java-version: '17'
21+
distribution: 'zulu'
22+
- name: Build with Gradle
23+
run: ./gradlew build
24+
- name: Get Release Version
25+
id: get_version
26+
run: VERSION=$(./gradlew currentVersion -q -Prelease.quiet) && echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
27+
- name: Create Release
28+
run: |
29+
gh release create \
30+
--generate-notes \
31+
--title 'Release ${{ steps.get_version.outputs.VERSION }}' \
32+
${{ github.ref_name }} \
33+
build/libs/yaml-text-source-${{ steps.get_version.outputs.VERSION }}.zip
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
- name: Publish to Maven Central
37+
run: ./gradlew -PsigningKey=${SIGNING_KEY_B64} -PsigningPassword=${SIGNING_PASSWORD} -PsonatypeUsername=${SONATYPE_USERNAME} -PsonatypePassword=${SONATYPE_PASSWORD} publishToSonatype closeAndReleaseSonatypeStagingRepository
38+
env:
39+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
40+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
41+
SIGNING_KEY_B64: ${{ secrets.SIGNING_KEY_B64 }}
42+
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}

build.gradle

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
plugins {
22
id 'java'
3-
id 'pl.allegro.tech.build.axion-release' version '1.18.11'
4-
id 'maven-publish'
3+
id 'pl.allegro.tech.build.axion-release' version '1.18.17'
4+
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
55
}
66

7+
group = 'org.rundeck.plugins'
8+
79
repositories {
810
mavenCentral()
911
}
@@ -20,15 +22,21 @@ ext.pluginBaseFolder = "."
2022
// No Java dependencies needed - this is a script-based plugin
2123

2224
scmVersion {
23-
ignoreUncommittedChanges = true
25+
ignoreUncommittedChanges = false
2426
tag {
25-
prefix = ''
27+
prefix = '' // NO "v" prefix - see PLUGIN_TAGGING_ARCHITECTURE.md
2628
versionSeparator = ''
2729
}
30+
versionCreator 'simple' // Use simple version creator (just tag name)
2831
}
2932

30-
project.version = scmVersion.version
33+
version = scmVersion.version // Dynamic version from git tag
3134
ext.archiveFilename = ext.archivesBaseName + '-' + version
35+
ext.publishName = "YAML Test Source ${project.version}"
36+
ext.githubSlug = 'rundeck-plugins/yaml-text-source'
37+
ext.developers = [
38+
[id: 'gschueler', name: 'Greg Schueler', email: 'greg@rundeck.com']
39+
]
3240

3341
// Plugin ZIP task (modernized from the external script)
3442
tasks.register('pluginZip', Jar) {
@@ -86,14 +94,18 @@ tasks.register('pluginZip', Jar) {
8694
}
8795
}
8896

89-
publishing {
90-
publications {
91-
mavenZip(MavenPublication) {
92-
artifact pluginZip
97+
nexusPublishing {
98+
packageGroup = 'org.rundeck.plugins'
99+
repositories {
100+
sonatype {
101+
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
102+
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
93103
}
94104
}
95105
}
96106

107+
apply from: "${rootDir}/gradle/publishing.gradle"
108+
97109
build {
98110
dependsOn 'pluginZip'
99111
}

gradle/publishing.gradle

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/**
2+
* Zip-based Rundeck plugin publication for Maven Central (artifact uploaded as type jar).
3+
* Requires: ext.publishName, ext.githubSlug, ext.developers; task pluginZip
4+
*/
5+
apply plugin: 'maven-publish'
6+
apply plugin: 'signing'
7+
8+
publishing {
9+
publications {
10+
mavenZip(MavenPublication) {
11+
groupId = project.group.toString()
12+
artifactId = 'yaml-text-source'
13+
version = project.version.toString()
14+
15+
artifact(tasks.named('pluginZip')) {
16+
extension = 'jar'
17+
}
18+
19+
pom {
20+
packaging = 'jar'
21+
name = publishName
22+
description = project.ext.hasProperty('publishDescription') ? project.ext.publishDescription :
23+
project.description ?: publishName
24+
url = "https://github.com/${githubSlug}"
25+
licenses {
26+
license {
27+
name = 'The Apache Software License, Version 2.0'
28+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
29+
distribution = 'repo'
30+
}
31+
}
32+
scm {
33+
url = "https://github.com/${githubSlug}"
34+
connection = "scm:git:git@github.com/${githubSlug}.git"
35+
developerConnection = "scm:git:git@github.com:${githubSlug}.git"
36+
}
37+
if (project.ext.developers) {
38+
developers {
39+
project.ext.developers.each { dev ->
40+
developer {
41+
id = dev.id
42+
name = dev.name
43+
email = dev.email
44+
}
45+
}
46+
}
47+
}
48+
}
49+
}
50+
}
51+
repositories {
52+
def pkgcldWriteToken = System.getenv("PKGCLD_WRITE_TOKEN") ?: project.findProperty("pkgcldWriteToken")
53+
if (pkgcldWriteToken) {
54+
maven {
55+
name = "PackageCloudTest"
56+
url = uri("https://packagecloud.io/pagerduty/rundeckpro-test/maven2")
57+
authentication {
58+
header(HttpHeaderAuthentication)
59+
}
60+
credentials(HttpHeaderCredentials) {
61+
name = "Authorization"
62+
value = "Bearer " + pkgcldWriteToken
63+
}
64+
}
65+
}
66+
}
67+
}
68+
69+
def base64Decode = { String prop ->
70+
project.findProperty(prop) ?
71+
new String(Base64.getDecoder().decode(project.findProperty(prop).toString())).trim() :
72+
null
73+
}
74+
75+
if (project.hasProperty('signingKey') && project.hasProperty('signingPassword')) {
76+
signing {
77+
useInMemoryPgpKeys(base64Decode("signingKey"), project.signingPassword)
78+
sign(publishing.publications)
79+
}
80+
}

gradle/wrapper/gradle-wrapper.jar

-17.6 KB
Binary file not shown.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
44
networkTimeout=10000
5+
validateDistributionUrl=true
56
zipStoreBase=GRADLE_USER_HOME
67
zipStorePath=wrapper/dists

gradlew

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

gradlew.bat

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

0 commit comments

Comments
 (0)