Skip to content

Commit

Permalink
upgrade gradle
Browse files Browse the repository at this point in the history
add release process
  • Loading branch information
ltamaster committed Jun 2, 2023
1 parent 1869db0 commit 38edddb
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 9 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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
46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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
22 changes: 14 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.gradle.api.tasks.testing.Test

/*
* Copyright 2017 Rundeck, Inc. (http://rundeck.com)
*
Expand All @@ -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'
}


Expand Down Expand Up @@ -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"
Expand All @@ -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) {
Expand Down Expand Up @@ -93,3 +95,7 @@ jar {
}
dependsOn(copyToLib)
}

tasks.withType(Test) {
useJUnitPlatform()
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 38edddb

Please sign in to comment.