Skip to content

Commit 98a282d

Browse files
committed
(#386) Setup initial publishing from GH Actions
1 parent 6b47d5d commit 98a282d

File tree

9 files changed

+80
-122
lines changed

9 files changed

+80
-122
lines changed

.github/workflows/build.yml

+42-3
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ jobs:
114114
- name: Build
115115
uses: eskatos/gradle-command-action@v1
116116
with:
117-
arguments: -i -S --console=plain --no-build-cache assemble
118-
# Unit tests
117+
arguments: -i -S --console=plain --no-build-cache assemble validateTaskProperties
118+
# Unit tests
119119
- name: Unit tests
120120
uses: eskatos/gradle-command-action@v1
121121
with:
@@ -136,4 +136,43 @@ jobs:
136136
with:
137137
name: Test reports
138138
path: "**/build/reports/**"
139-
retention-days: 5
139+
retention-days: 5
140+
publish:
141+
runs-on: ubuntu-latest
142+
# on:
143+
# push:
144+
# branches:
145+
# - release
146+
needs: build
147+
if: ${{ github.repository == 'jruby-gradle/jruby-gradle-plugin' && github.ref == 'refs/heads/release' }}
148+
steps:
149+
- uses: actions/checkout@v1
150+
- uses: actions/setup-java@v1
151+
with:
152+
java-version: 8
153+
- name: Cache .gradle/caches
154+
uses: actions/cache@v1
155+
with:
156+
path: ~/.gradle/caches
157+
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle') }}
158+
restore-keys: ${{ runner.os }}-gradle-cache-
159+
- name: Cache .gradle/wrapper
160+
uses: actions/cache@v1
161+
with:
162+
path: ~/.gradle/wrapper
163+
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/*.gradle') }}
164+
restore-keys: ${{ runner.os }}-gradle-wrapper-
165+
- name: Publish to Gradle Portal
166+
uses: eskatos/gradle-command-action@v1
167+
env:
168+
PUBLISH_KEY: ${{ secrets.PUBLISH_KEY }}
169+
PUBLISH_SECRET: ${{ secrets.PUBLISH_SECRET }}
170+
with:
171+
arguments: -i --console=plain --no-build-cache assemble publishPlugins -Dgradle.publish.key=$PUBLISH_KEY -Dgradle.publish.secret=$PUBLISH_SECRET
172+
- name: Publish documentation
173+
uses: eskatos/gradle-command-action@v1
174+
env:
175+
GH_PAGES_PUSH_USER: ${{ secrets.GH_PAGES_PUSH_USER }}
176+
GH_PAGES_PUSH_TOKEN: ${{ secrets.GH_PAGES_PUSH_TOKEN }}
177+
with:
178+
arguments: -i --console=plain --no-build-cache docs:publishGhPages -Dorg.ajoberstar.grgit.auth.username=$GH_PAGES_PUSH_USER -Dorg.ajoberstar.grgit.auth.password=$GH_PAGES_PUSH_TOKEN -Dorg.ajoberstar.grgit.auth.force=hardcoded

.sdkmanrc

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
# Enable auto-env through the sdkman_auto_env config
22
# Add key=value pairs of SDKs to use below
3+
<<<<<<< HEAD
34
java=8.0.265.j9-adpt
5+
=======
6+
java=8.0.282.hs-adpt
7+
>>>>>>> 998cb79 (Add sdkmanrc file and set to use JDK8)

base-plugin/build.gradle

+7-37
Original file line numberDiff line numberDiff line change
@@ -102,46 +102,16 @@ task installGroovyDoc(type: Copy) {
102102
onlyIf { project.hasProperty('jrubyGradleWebsiteInstallDir') }
103103
}
104104

105-
106-
publishing {
107-
publications {
108-
maven(MavenPublication) {
109-
// groupId project.group
110-
// artifactId project.archivesBaseName
111-
// version project.version
112-
113-
artifact sourcesJar {
114-
classifier "sources"
115-
}
116-
117-
from components.java
118-
}
119-
}
120-
}
121-
122-
bintray {
123-
user = project.bintrayUser
124-
key = project.bintrayKey
125-
publish = true
126-
dryRun = false
127-
publications = ['maven']
128-
129-
pkg {
130-
userOrg = 'jruby-gradle'
131-
repo = 'plugins'
132-
name = 'jruby-gradle-plugin'
133-
labels = ['jruby']
134-
135-
version {
136-
name = project.version
137-
vcsTag = "v${project.version}"
138-
attributes = ['gradle-plugin': 'com.github.jruby-gradle.base:com.github.jruby-gradle:jruby-gradle-plugin']
139-
desc = 'The purpose of plugin is to encapsulate useful Gradle functionality for JRuby projects.'
140-
105+
pluginBundle {
106+
plugins {
107+
gradlePlugin {
108+
id = 'com.github.jruby-gradle.base'
109+
displayName = 'JRuby/Gradle base plugin'
110+
description = 'The purpose of plugin is to encapsulate useful Gradle functionality for JRuby projects'
111+
tags = (['jruby'])
141112
}
142113
}
143114
}
144-
bintrayUpload.dependsOn assemble
145115

146116
gradleTest.mustRunAfter integrationTest
147117
// vim: ft=groovy

base-plugin/src/main/groovy/com/github/jrubygradle/GenerateGradleRb.groovy

-5
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,6 @@ class GenerateGradleRb extends DefaultTask implements JRubyAwareTask {
100100
getGemInstallDir().absolutePath
101101
}
102102

103-
@Input
104-
protected String getGemInstallDirPath() {
105-
getGemInstallDir().absolutePath
106-
}
107-
108103
@TaskAction
109104
@CompileDynamic
110105
@SuppressWarnings('DuplicateStringLiteral')

build.gradle

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
plugins {
22
id 'com.gradle.build-scan' version '2.0.2'
33
id 'org.ysb33r.gradletest' version '2.0-rc.4' apply false
4-
id 'com.jfrog.bintray' version '1.8.4' apply false
54
id 'org.ajoberstar.github-pages' version '1.2.0' apply false
6-
id 'org.ysb33r.cloudci.appveyor.testreporter' version '2.5' apply false
75
id 'com.github.hierynomus.license' version '0.14.0' apply false
86
id 'io.ratpack.ratpack-java' version "1.6.1" apply false
7+
id 'com.gradle.plugin-publish' version '0.14.0' apply false
98
}
109

1110
buildScan {
@@ -33,8 +32,6 @@ allprojects {
3332
}
3433

3534
subprojects {
36-
apply plugin: 'maven'
37-
3835
repositories {
3936
mavenCentral()
4037
gradlePluginPortal()
@@ -45,10 +42,8 @@ subprojects {
4542
apply plugin: 'java-gradle-plugin'
4643
apply plugin: 'groovy'
4744
apply plugin: 'codenarc'
48-
apply plugin: 'com.jfrog.bintray'
4945
apply plugin: 'org.ysb33r.gradletest'
50-
apply plugin: 'maven-publish'
51-
apply plugin: 'org.ysb33r.cloudci.appveyor.testreporter'
46+
apply plugin: 'com.gradle.plugin-publish'
5247
apply from: "${rootProject.projectDir}/gradle/integration-tests.gradle"
5348
apply from: "${rootProject.projectDir}/gradle/license.gradle"
5449

@@ -93,8 +88,6 @@ subprojects {
9388
dependsOn jar
9489
}
9590

96-
install.dependsOn check
97-
9891
tasks.withType(Test) {
9992
if (gradle.startParameter.isOffline()) {
10093
systemProperties 'TESTS_ARE_OFFLINE': '1'

core-plugin/build.gradle

+7-21
Original file line numberDiff line numberDiff line change
@@ -18,33 +18,19 @@ artifacts {
1818
archives sourcesJar
1919
}
2020

21-
bintray {
22-
user = project.bintrayUser
23-
key = project.bintrayKey
24-
publish = true
25-
dryRun = false
26-
configurations = ['archives']
27-
28-
pkg {
29-
userOrg = 'jruby-gradle'
30-
repo = 'plugins'
31-
name = 'jruby-gradle-core-plugin'
32-
labels = ['jruby']
33-
34-
version {
35-
name = project.version
36-
vcsTag = "v${project.version}"
37-
attributes = ['gradle-plugin': 'com.github.jruby-gradle.core:com.github.jruby-gradle:jruby-gradle-core-plugin']
38-
desc = 'This plugin provides some core dependency resolution for JRuby/Gradle'
21+
pluginBundle {
22+
plugins {
23+
gradlePlugin {
24+
id = 'com.github.jruby-gradle.core'
25+
displayName = 'JRuby/Gradle core plugin'
26+
description = 'This plugin provides some core dependency resolution for JRuby/Gradle'
27+
tags = (['jruby'])
3928
}
4029
}
4130
}
4231

43-
4432
processResources {
4533
filesMatching '**/com.jrubygradle.core-plugin.version.properties', {
4634
expand VERSION : project.version
4735
}
4836
}
49-
50-
bintrayUpload.dependsOn assemble

docs/build.gradle

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
buildscript {
22
repositories {
33
jcenter()
4-
maven {
5-
url "https://plugins.gradle.org/m2/"
6-
}
4+
gradlePluginPortal()
75
}
86
dependencies {
97
/* wow. so recursion */
@@ -30,7 +28,7 @@ dependencies {
3028
}
3129

3230
task prepareGroovyDocs(type: Copy) {
33-
description "Copy Groovydocs into our site directory for deploybment/publication"
31+
description "Copy Groovydocs into our site directory for deployment/publication"
3432
into "${buildDir}/_site/groovydoc"
3533

3634
rootProject.subprojects.each {

jar-plugin/build.gradle

+7-22
Original file line numberDiff line numberDiff line change
@@ -87,32 +87,17 @@ artifacts {
8787
archives sourcesJar
8888
}
8989

90-
bintray {
91-
user = project.bintrayUser
92-
key = project.bintrayKey
93-
publish = true
94-
dryRun = false
95-
configurations = ['archives']
96-
97-
pkg {
98-
userOrg = 'jruby-gradle'
99-
repo = 'plugins'
100-
name = 'jruby-gradle-jar-plugin'
101-
labels = ['jruby']
102-
103-
version {
104-
name = project.version
105-
vcsTag = "v${project.version}"
106-
attributes = ['gradle-plugin' : 'com.github.jruby-gradle.jar:com.github.jruby-gradle:jruby-gradle-jar-plugin']
107-
desc = 'This plugin encapsulates java archive building functionality for JRuby Gradle projects'
90+
pluginBundle {
91+
plugins {
92+
gradlePlugin {
93+
id = 'com.github.jruby-gradle.jar'
94+
displayName = 'JRuby/Gradle base plugin'
95+
description = 'This plugin encapsulates java archive building functionality for JRuby Gradle projects'
96+
tags = (['jruby','fatjar'])
10897
}
10998
}
11099
}
111100

112-
bintrayUpload {
113-
dependsOn assemble
114-
}
115-
116101
gradleTest {
117102
dependsOn jar
118103
mustRunAfter test, integrationTest

war-plugin/build.gradle

+9-21
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,24 @@ dependencies {
55
compile project(':jruby-gradle-plugin')
66
compile group: 'com.github.jruby-gradle', name: 'warbler-bootstrap', version: '0.2.0+'
77

8-
testCompile (spockVersion) {
9-
exclude module : 'groovy-all'
8+
testCompile(spockVersion) {
9+
exclude module: 'groovy-all'
1010
}
1111
}
1212

1313
artifacts {
1414
archives sourcesJar
1515
}
1616

17-
bintray {
18-
user = project.bintrayUser
19-
key = project.bintrayKey
20-
publish = true
21-
dryRun = false
22-
configurations = ['archives']
23-
24-
pkg {
25-
userOrg = 'jruby-gradle'
26-
repo = 'plugins'
27-
name = 'jruby-gradle-war-plugin'
28-
labels = ['jruby','war','java']
29-
30-
version {
31-
name = project.version
32-
vcsTag = "v${project.version}"
33-
attributes = ['gradle-plugin' : 'com.github.jruby-gradle.war:com.github.jruby-gradle:jruby-gradle-war-plugin']
34-
desc = project.description
17+
pluginBundle {
18+
plugins {
19+
gradlePlugin {
20+
id = 'com.github.jruby-gradle.jar'
21+
displayName = 'JRuby/Gradle base plugin'
22+
description = 'This plugin encapsulates building deployable WARs using JRuby'
23+
tags = (['jruby', 'war'])
3524
}
3625
}
3726
}
38-
bintrayUpload.dependsOn assemble
3927

4028
// vim: ft=groovy

0 commit comments

Comments
 (0)