Skip to content

Update build [claude] #410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
24 changes: 8 additions & 16 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
name: Java CI

on: [push]
on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get Fetch Tags
run: git -c protocol.version=2 fetch --tags --progress --no-recurse-submodules origin
if: "!contains(github.ref, 'refs/tags')"
- name: Set up JDK 1.11
uses: actions/setup-java@v1
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: 11
- name: Grant execute permission for gradlew
run: chmod +x gradlew
java-version: '11'
distribution: 'zulu'
- name: Build with Gradle
run: ./gradlew build
- name: Copy Artifact for integration test
Expand All @@ -28,11 +22,9 @@ jobs:
run: ./gradlew :functional-test:functionalTest
- name: Get Release Version
id: get_version
run: VERSION=$(./gradlew currentVersion -q -Prelease.quiet) && echo ::set-output name=VERSION::$VERSION
run: VERSION=$(./gradlew currentVersion -q -Prelease.quiet) && echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Upload plugin jar
uses: actions/upload-artifact@v4
with:
# Artifact name
name: Grails-Plugin-${{ steps.get_version.outputs.VERSION }}
# Directory containing files to upload
name: ansible-plugin-${{ steps.get_version.outputs.VERSION }}
path: build/libs/ansible-plugin-${{ steps.get_version.outputs.VERSION }}.jar
44 changes: 21 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,43 @@ on:
push:
# Sequence of patterns matched against refs/tags
tags:
- '*' # Push events to matching v*, i.e. v1.0, v20.15.10
- 'v[0-9]+.[0-9]+.[0-9]+' # Push events to matching v*, i.e. v1.0, v20.15.10

name: Upload Release Asset
name: Publish Release

jobs:
build:
name: Upload Release Asset
name: Publish Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: set up JDK 1.11
uses: actions/setup-java@v1
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: 11
java-version: '11'
distribution: 'zulu'
- name: Build with Gradle
run: ./gradlew build
- name: Get Release Version
id: get_version
run: VERSION=$(./gradlew currentVersion -q -Prelease.quiet) && echo ::set-output name=VERSION::$VERSION
run: VERSION=$(./gradlew currentVersion -q -Prelease.quiet) && echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Create Release
id: create_release
uses: actions/create-release@v1.0.0
run: |
gh release create \
--generate-notes \
--title 'Release ${{ steps.get_version.outputs.VERSION }}' \
${{ github.ref_name }} \
build/libs/ansible-plugin-${{ steps.get_version.outputs.VERSION }}.jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ steps.get_version.outputs.VERSION }}
draft: false
prerelease: false
- name: Upload Release Asset (jar)
id: upload-release-asset
uses: actions/upload-release-asset@v1
- name: Publish to Maven Central
run: ./gradlew -PsigningKey=${SIGNING_KEY_B64} -PsigningPassword=${SIGNING_PASSWORD} -PsonatypeUsername=${SONATYPE_USERNAME} -PsonatypePassword=${SONATYPE_PASSWORD} publishToSonatype closeAndReleaseSonatypeStagingRepository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/libs/ansible-plugin-${{ steps.get_version.outputs.VERSION }}.jar
asset_name: ansible-plugin-${{ steps.get_version.outputs.VERSION }}.jar
asset_content_type: application/octet-stream
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SIGNING_KEY_B64: ${{ secrets.SIGNING_KEY_B64 }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
150 changes: 83 additions & 67 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,105 +1,121 @@
plugins {
id 'pl.allegro.tech.build.axion-release' version '1.17.2'
id 'maven-publish'
id 'java'
id 'groovy'
id 'idea'
alias(libs.plugins.axionRelease)
alias(libs.plugins.nexusPublish)
}

group = 'com.github.rundeck-plugins'
group = 'org.rundeck.plugins'

ext.pluginName = 'Ansible Integration'
ext.publishDescription = 'This plugin brings basic Ansible support to Rundeck. It imports hosts from Ansible\'s inventory, including a bunch of facts, and can run modules and playbooks. There is also a node executor and file copier for your project.'
ext.publishName = "Ansible Plugin ${project.version}"
ext.githubSlug = 'rundeck-plugins/ansible-plugin'
ext.developers = [
[id: 'gschueler', name: 'Greg Schueler', email: 'greg@rundeck.com'],
[id: 'daisuke-yoshimoto', name: 'Daisuke Yoshimoto', email: 'yoshimoto@gmail.com']
]
ext.rundeckPluginVersion = '1.2'
ext.pluginClassNames = [
'com.rundeck.plugins.ansible.plugin.AnsibleResourceModelSourceFactory',
'com.rundeck.plugins.ansible.plugin.AnsibleNodeExecutor',
'com.rundeck.plugins.ansible.plugin.AnsibleFileCopier',
'com.rundeck.plugins.ansible.plugin.AnsiblePlaybookWorkflowStep',
'com.rundeck.plugins.ansible.plugin.AnsiblePlaybookInlineWorkflowStep',
'com.rundeck.plugins.ansible.plugin.AnsibleModuleWorkflowStep',
'com.rundeck.plugins.ansible.plugin.AnsiblePlaybookWorflowNodeStep',
'com.rundeck.plugins.ansible.plugin.AnsiblePlaybookInlineWorkflowNodeStep',
'com.rundeck.plugins.ansible.logging.AnsibleSetStatsFilterPlugin',
'com.rundeck.plugins.ansible.plugin.AnsiblePluginGroup'
'com.rundeck.plugins.ansible.plugin.AnsibleResourceModelSourceFactory',
'com.rundeck.plugins.ansible.plugin.AnsibleNodeExecutor',
'com.rundeck.plugins.ansible.plugin.AnsibleFileCopier',
'com.rundeck.plugins.ansible.plugin.AnsiblePlaybookWorkflowStep',
'com.rundeck.plugins.ansible.plugin.AnsiblePlaybookInlineWorkflowStep',
'com.rundeck.plugins.ansible.plugin.AnsibleModuleWorkflowStep',
'com.rundeck.plugins.ansible.plugin.AnsiblePlaybookWorflowNodeStep',
'com.rundeck.plugins.ansible.plugin.AnsiblePlaybookInlineWorkflowNodeStep',
'com.rundeck.plugins.ansible.logging.AnsibleSetStatsFilterPlugin',
'com.rundeck.plugins.ansible.plugin.AnsiblePluginGroup'
].join(',')

apply plugin: 'java'
apply plugin: 'groovy'
sourceCompatibility = 1.11

scmVersion {
ignoreUncommittedChanges = false
tag {
prefix = 'v'
versionSeparator = ''
}
ignoreUncommittedChanges = false
}

version = scmVersion.version
allprojects {
project.version = scmVersion.version
apply from: "${rootDir}/gradle/java.gradle"
}

repositories {
mavenCentral()
mavenLocal()
mavenCentral()
}

configurations {
pluginLibs
pluginLibs

implementation {
extendsFrom pluginLibs
}
implementation {
extendsFrom pluginLibs
}
}

dependencies {
pluginLibs 'com.google.code.gson:gson:2.10.1'
implementation('org.rundeck:rundeck-core:5.1.1-20240305')
implementation 'org.codehaus.groovy:groovy-all:3.0.15'
pluginLibs group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.16.1'
pluginLibs group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.16.1'
implementation "org.yaml:snakeyaml:2.2"
pluginLibs libs.gson
implementation(libs.rundeckCore) {
exclude group: "com.google.guava"
}
implementation libs.groovyAll
pluginLibs libs.jacksonCore
pluginLibs libs.jacksonYaml
implementation libs.snakeyaml

compileOnly 'org.projectlombok:lombok:1.18.30'
annotationProcessor 'org.projectlombok:lombok:1.18.30'
compileOnly libs.lombok
annotationProcessor libs.lombok

testCompileOnly 'org.projectlombok:lombok:1.18.30'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.30'
testCompileOnly libs.lombok
testAnnotationProcessor libs.lombok

testImplementation "org.spockframework:spock-core:2.1-groovy-3.0"
testImplementation libs.bundles.testLibs
}

task copyToLib(type: Copy) {
into "$buildDir/output/lib"
from configurations.pluginLibs
}

tasks.withType(Test).configureEach {
useJUnitPlatform()
jar {
from "$buildDir/output"
manifest {
def libList = configurations.pluginLibs.collect{'lib/' + it.name}.join(' ')
attributes 'Rundeck-Plugin-Version': rundeckPluginVersion,
'Rundeck-Plugin-Archive': 'true',
'Rundeck-Plugin-File-Version': project.version,
'Rundeck-Plugin-Name' : pluginName,
'Rundeck-Plugin-Description' : publishDescription,
'Rundeck-Plugin-Rundeck-Compatibility-Version': '3.0.1+',
'Rundeck-Plugin-Tags': 'java,node executor,resource model,workflow step,ansible',
'Rundeck-Plugin-License': 'MIT',
'Rundeck-Plugin-Source-Link': 'https://github.com/rundeck-plugins/ansible-plugin',
'Rundeck-Plugin-Target-Host-Compatibility': 'all',
'Rundeck-Plugin-Author': 'David Kirstein',
'Rundeck-Plugin-Classnames': pluginClassNames,
'Rundeck-Plugin-URL': 'https://github.com/rundeck-plugins/ansible-plugin',
'Rundeck-Plugin-Libs': "${libList}",
'Rundeck-Plugin-Date': new Date().format("yyyy-MM-dd'T'HH:mm:ssX")
}
dependsOn(copyToLib)
}

task copyToLib(type: Copy) {
into "$buildDir/output/lib"
from configurations.pluginLibs
test {
useJUnitPlatform()
}

jar {
from "$buildDir/output"
manifest {
def libList = configurations.pluginLibs.collect{'lib/' + it.name}.join(' ')
attributes 'Rundeck-Plugin-Name' : 'Ansible Integration'
attributes 'Rundeck-Plugin-Description' : 'This plugin brings basic Ansible support to Rundeck. It imports hosts from Ansible\'s inventory, including a bunch of facts, and can run modules and playbooks. There is also a node executor and file copier for your project.'
attributes 'Rundeck-Plugin-Rundeck-Compatibility-Version': '3.0.1+'
attributes 'Rundeck-Plugin-Tags': 'java,node executor,resource model,workflow step,ansible'
attributes 'Rundeck-Plugin-License': 'MIT'
attributes 'Rundeck-Plugin-Source-Link': 'https://github.com/rundeck-plugins/ansible-plugin'
attributes 'Rundeck-Plugin-Target-Host-Compatibility': 'all'
attributes 'Rundeck-Plugin-Author': 'David Kirstein'
attributes 'Rundeck-Plugin-Classnames': pluginClassNames
attributes 'Rundeck-Plugin-File-Version': version
attributes 'Rundeck-Plugin-Version': rundeckPluginVersion
attributes 'Rundeck-Plugin-Archive': 'true'
attributes 'Rundeck-Plugin-Libs': "${libList}"
attributes 'Rundeck-Plugin-URL': 'https://github.com/rundeck-plugins/ansible-plugin'
}
dependsOn(copyToLib)
javadoc {
options.addStringOption('Xdoclint:none', '-quiet')
failOnError = false
}

publishing {
publications {
maven(MavenPublication) {
artifactId = 'ansible-plugin'
from components.java
nexusPublishing {
packageGroup = 'org.rundeck.plugins'
repositories {
sonatype()
}
}
}

apply from: "${rootDir}/gradle/publishing.gradle"
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
group=org.rundeck.plugins
13 changes: 13 additions & 0 deletions gradle/java.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
java {
sourceCompatibility = JavaVersion.VERSION_11
withJavadocJar()
withSourcesJar()
}

allprojects {
gradle.projectsEvaluated {
tasks.withType(JavaCompile).configureEach {
options.compilerArgs.add("-Xlint:deprecation")
}
}
}
34 changes: 34 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[versions]
axionRelease = "1.18.18"
groovy = "3.0.24"
rundeckCore = "5.10.0-20250312"
nexusPublish = "2.0.0"
spock = "2.3-groovy-3.0"
gson = "2.10.1"
jackson = "2.16.1"
snakeyaml = "2.2"
lombok = "1.18.30"
cglib = "3.3.0"
byteBuddy = "1.14.12"
objenesis = "3.3"

[libraries]
rundeckCore = { group = "org.rundeck", name = "rundeck-core", version.ref = "rundeckCore" }
groovyAll = { group = "org.codehaus.groovy", name = "groovy-all", version.ref = "groovy" }
spockCore = { group = "org.spockframework", name = "spock-core", version.ref = "spock" }
gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" }
jacksonCore = { group = "com.fasterxml.jackson.core", name = "jackson-core", version.ref = "jackson" }
jacksonYaml = { group = "com.fasterxml.jackson.dataformat", name = "jackson-dataformat-yaml", version.ref = "jackson" }
snakeyaml = { group = "org.yaml", name = "snakeyaml", version.ref = "snakeyaml" }
lombok = { group = "org.projectlombok", name = "lombok", version.ref = "lombok" }
cglib = { group = "cglib", name = "cglib-nodep", version.ref = "cglib" }
byteBuddy = { group = "net.bytebuddy", name = "byte-buddy", version.ref = "byteBuddy" }
objenesis = { group = "org.objenesis", name = "objenesis", version.ref = "objenesis" }

[bundles]
testLibs = ["groovyAll", "spockCore", "cglib", "byteBuddy", "objenesis"]
jacksonLibs = ["jacksonCore", "jacksonYaml"]

[plugins]
axionRelease = { id = "pl.allegro.tech.build.axion-release", version.ref = "axionRelease" }
nexusPublish = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "nexusPublish" }
Loading