From 38edddbe6cb106d58b30268d520746b2dcf73e22 Mon Sep 17 00:00:00 2001 From: Luis Toledo Date: Fri, 2 Jun 2023 16:40:27 -0400 Subject: [PATCH] upgrade gradle add release process --- .github/workflows/gradle.yml | 34 ++++++++++++++++++ .github/workflows/release.yml | 46 ++++++++++++++++++++++++ build.gradle | 22 +++++++----- gradle/wrapper/gradle-wrapper.properties | 2 +- 4 files changed, 95 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/gradle.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 0000000..b892415 --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,34 @@ +name: Java CI + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + 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 + with: + java-version: 1.8 + - 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 + - name: Upload plugin jar + uses: actions/upload-artifact@v1.0.0 + with: + # Artifact name + name: Grails-Plugin-${{ steps.get_version.outputs.VERSION }} + # Directory containing files to upload + path: build/libs/aws-s3-model-source-${{ steps.get_version.outputs.VERSION }}.jar \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d4a6f9c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,46 @@ +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - '*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +name: Upload Release Asset + +jobs: + build: + name: Upload Release Asset + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - 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 + - name: Create Release + id: create_release + uses: actions/create-release@v1.0.0 + 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 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: build/libs/aws-s3-model-source-${{ steps.get_version.outputs.VERSION }}.jar + asset_name: aws-s3-model-source-${{ steps.get_version.outputs.VERSION }}.jar + asset_content_type: application/octet-stream \ No newline at end of file diff --git a/build.gradle b/build.gradle index 33a8781..d99ea0f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,3 +1,5 @@ +import org.gradle.api.tasks.testing.Test + /* * Copyright 2017 Rundeck, Inc. (http://rundeck.com) * @@ -14,7 +16,7 @@ * limitations under the License. */ plugins{ - id 'pl.allegro.tech.build.axion-release' version '1.9.3' + id 'pl.allegro.tech.build.axion-release' version '1.13.4' } @@ -45,14 +47,14 @@ version scmVersion.version configurations { pluginLibs - compile { + implementation { extendsFrom pluginLibs } } dependencies { - compile group: 'org.rundeck', name: 'rundeck-core', version: '2.10.0' - compile "org.slf4j:slf4j-api:1.7.30" + implementation group: 'org.rundeck', name: 'rundeck-core', version: '4.13.0-20230515' + implementation "org.slf4j:slf4j-api:1.7.30" pluginLibs ('com.amazonaws:aws-java-sdk-s3:1.12.479') { exclude group: "com.fasterxml.jackson.core" exclude group: "com.fasterxml.jackson.dataformat" @@ -62,10 +64,10 @@ dependencies { exclude group: "com.fasterxml.jackson.dataformat" } - 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.9" + testImplementation "org.spockframework:spock-core:2.0-groovy-3.0" + testImplementation "cglib:cglib-nodep:2.2.2" + testImplementation 'org.objenesis:objenesis:1.4' } task copyToLib(type: Copy) { @@ -93,3 +95,7 @@ jar { } dependsOn(copyToLib) } + +tasks.withType(Test) { + useJUnitPlatform() +} \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f4d7b2b..92f06b5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists