diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 26862d2..c6e50b2 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -8,25 +8,26 @@ jobs: 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.8 - uses: actions/setup-java@v1 + - name: Set up JDK 11 + uses: actions/setup-java@v4 with: - java-version: 1.8 + java-version: '11' + distribution: 'zulu' - name: Grant execute permission for gradlew run: chmod +x gradlew - 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: Upload git-plugin jar - uses: actions/upload-artifact@v1.0.0 + uses: actions/upload-artifact@v4 with: # Artifact name name: git-resource-model-${{ steps.get_version.outputs.VERSION }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fa32aff..887b516 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,36 +12,34 @@ jobs: 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.8 - uses: actions/setup-java@v1 + + - name: Set up JDK 11 + uses: actions/setup-java@v4 with: - java-version: 1.8 + 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/git-resource-model-${{ 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/git-resource-model-${{ steps.get_version.outputs.VERSION }}.jar - asset_name: git-resource-model-${{ 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 }} diff --git a/build.gradle b/build.gradle index 51615bb..afebbc8 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,6 @@ plugins { - id 'pl.allegro.tech.build.axion-release' version '1.11.0' + id 'pl.allegro.tech.build.axion-release' version '1.18.18' + id 'java' } group 'com.rundeck' @@ -9,23 +10,18 @@ ext.pluginClassNames='com.rundeck.plugin.GitResourceModelFactory' ext.pluginName = 'Git Resource Model' ext.pluginDescription = 'Writable Git Resource Model' -//sourceCompatibility = 1.8 +java { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 +} scmVersion { ignoreUncommittedChanges = true tag { prefix = '' versionSeparator = '' - def origDeserialize=deserialize - //apend .0 to satisfy semver if the tag version is only X.Y - deserialize = { config, position, tagName -> - def orig = origDeserialize(config, position, tagName) - if (orig.split('\\.').length < 3) { - orig += ".0" - } - orig - } } + versionCreator("simple") } project.version = scmVersion.version @@ -39,29 +35,34 @@ repositories { configurations { pluginLibs - compile { + implementation { extendsFrom pluginLibs } } dependencies { - compile 'org.codehaus.groovy:groovy-all:2.3.11' - testCompile group: 'junit', name: 'junit', version: '4.12' + implementation 'org.codehaus.groovy:groovy-all:3.0.22' + testImplementation group: 'junit', name: 'junit', version: '4.13.2' + + implementation group: 'org.rundeck', name: 'rundeck-core', version: '5.10.0-20250312' + implementation 'org.slf4j:slf4j-api:1.7.30' - compile group: 'org.rundeck', name: 'rundeck-core', version: '2.10.1' - compile 'org.slf4j:slf4j-api:1.7.30' + pluginLibs( 'org.eclipse.jgit:org.eclipse.jgit.ssh.jsch:5.13.3.202401111512-r') { + exclude module: 'slf4j-api' + exclude group: 'org.bouncycastle' + } - pluginLibs( 'org.eclipse.jgit:org.eclipse.jgit:3.7.1.201504261725-r') { + pluginLibs('org.eclipse.jgit:org.eclipse.jgit:6.6.1.202309021850-r') { exclude module: 'slf4j-api' exclude module: 'jsch' exclude module: 'commons-logging' } - testCompile "org.codehaus.groovy:groovy-all:2.3.7" - testCompile "org.spockframework:spock-core:0.7-groovy-2.0" - testCompile "cglib:cglib-nodep:2.2.2" - testCompile 'org.objenesis:objenesis:1.4' + testImplementation "org.codehaus.groovy:groovy-all:3.0.22" + testImplementation "org.spockframework:spock-core:2.0-groovy-3.0" + testImplementation "cglib:cglib-nodep:3.3.0" + testImplementation 'org.objenesis:objenesis:1.4' } @@ -83,9 +84,3 @@ jar { dependsOn(copyToLib) } - -task wrapper(type: Wrapper) { - gradleVersion = '3.3' - distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" -} - diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 7958dff..1948b90 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index b6b6210..774fae8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Mon Dec 18 16:14:59 CLST 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip diff --git a/gradlew b/gradlew index 4453cce..af6708f 100755 --- a/gradlew +++ b/gradlew @@ -28,16 +28,16 @@ APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +DEFAULT_JVM_OPTS='"-Xmx64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" -warn ( ) { +warn () { echo "$*" } -die ( ) { +die () { echo echo "$*" echo @@ -155,7 +155,7 @@ if $cygwin ; then fi # Escape application args -save ( ) { +save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } diff --git a/src/test/groovy/com/rundeck/plugin/GitResourceModelSpec.groovy b/src/test/groovy/com/rundeck/plugin/GitResourceModelSpec.groovy index ca9acbb..b3f869f 100644 --- a/src/test/groovy/com/rundeck/plugin/GitResourceModelSpec.groovy +++ b/src/test/groovy/com/rundeck/plugin/GitResourceModelSpec.groovy @@ -5,7 +5,6 @@ import com.dtolabs.rundeck.core.common.INodeSet import com.dtolabs.rundeck.core.resources.format.ResourceFormatParser import com.dtolabs.rundeck.core.resources.format.ResourceFormatParserService import spock.lang.Specification -import org.apache.log4j.Logger /** * Created by luistoledo on 12/22/17.