(#386) Setup initial publishing from GH Actions

This commit is contained in:
Schalk Cronje 2021-05-02 21:09:28 +02:00
parent 6b47d5dca7
commit 98a282d204
9 changed files with 80 additions and 122 deletions

View File

@ -114,8 +114,8 @@ jobs:
- name: Build
uses: eskatos/gradle-command-action@v1
with:
arguments: -i -S --console=plain --no-build-cache assemble
# Unit tests
arguments: -i -S --console=plain --no-build-cache assemble validateTaskProperties
# Unit tests
- name: Unit tests
uses: eskatos/gradle-command-action@v1
with:
@ -136,4 +136,43 @@ jobs:
with:
name: Test reports
path: "**/build/reports/**"
retention-days: 5
retention-days: 5
publish:
runs-on: ubuntu-latest
# on:
# push:
# branches:
# - release
needs: build
if: ${{ github.repository == 'jruby-gradle/jruby-gradle-plugin' && github.ref == 'refs/heads/release' }}
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: 8
- name: Cache .gradle/caches
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-cache-
- name: Cache .gradle/wrapper
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle-wrapper-
- name: Publish to Gradle Portal
uses: eskatos/gradle-command-action@v1
env:
PUBLISH_KEY: ${{ secrets.PUBLISH_KEY }}
PUBLISH_SECRET: ${{ secrets.PUBLISH_SECRET }}
with:
arguments: -i --console=plain --no-build-cache assemble publishPlugins -Dgradle.publish.key=$PUBLISH_KEY -Dgradle.publish.secret=$PUBLISH_SECRET
- name: Publish documentation
uses: eskatos/gradle-command-action@v1
env:
GH_PAGES_PUSH_USER: ${{ secrets.GH_PAGES_PUSH_USER }}
GH_PAGES_PUSH_TOKEN: ${{ secrets.GH_PAGES_PUSH_TOKEN }}
with:
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

View File

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

View File

@ -102,47 +102,17 @@ task installGroovyDoc(type: Copy) {
onlyIf { project.hasProperty('jrubyGradleWebsiteInstallDir') }
}
publishing {
publications {
maven(MavenPublication) {
// groupId project.group
// artifactId project.archivesBaseName
// version project.version
artifact sourcesJar {
classifier "sources"
}
from components.java
pluginBundle {
plugins {
gradlePlugin {
id = 'com.github.jruby-gradle.base'
displayName = 'JRuby/Gradle base plugin'
description = 'The purpose of plugin is to encapsulate useful Gradle functionality for JRuby projects'
tags = (['jruby'])
}
}
}
bintray {
user = project.bintrayUser
key = project.bintrayKey
publish = true
dryRun = false
publications = ['maven']
pkg {
userOrg = 'jruby-gradle'
repo = 'plugins'
name = 'jruby-gradle-plugin'
labels = ['jruby']
version {
name = project.version
vcsTag = "v${project.version}"
attributes = ['gradle-plugin': 'com.github.jruby-gradle.base:com.github.jruby-gradle:jruby-gradle-plugin']
desc = 'The purpose of plugin is to encapsulate useful Gradle functionality for JRuby projects.'
}
}
}
bintrayUpload.dependsOn assemble
gradleTest.mustRunAfter integrationTest
// vim: ft=groovy

View File

@ -100,11 +100,6 @@ class GenerateGradleRb extends DefaultTask implements JRubyAwareTask {
getGemInstallDir().absolutePath
}
@Input
protected String getGemInstallDirPath() {
getGemInstallDir().absolutePath
}
@TaskAction
@CompileDynamic
@SuppressWarnings('DuplicateStringLiteral')

View File

@ -1,11 +1,10 @@
plugins {
id 'com.gradle.build-scan' version '2.0.2'
id 'org.ysb33r.gradletest' version '2.0-rc.4' apply false
id 'com.jfrog.bintray' version '1.8.4' apply false
id 'org.ajoberstar.github-pages' version '1.2.0' apply false
id 'org.ysb33r.cloudci.appveyor.testreporter' version '2.5' apply false
id 'com.github.hierynomus.license' version '0.14.0' apply false
id 'io.ratpack.ratpack-java' version "1.6.1" apply false
id 'com.gradle.plugin-publish' version '0.14.0' apply false
}
buildScan {
@ -33,8 +32,6 @@ allprojects {
}
subprojects {
apply plugin: 'maven'
repositories {
mavenCentral()
gradlePluginPortal()
@ -45,10 +42,8 @@ subprojects {
apply plugin: 'java-gradle-plugin'
apply plugin: 'groovy'
apply plugin: 'codenarc'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'org.ysb33r.gradletest'
apply plugin: 'maven-publish'
apply plugin: 'org.ysb33r.cloudci.appveyor.testreporter'
apply plugin: 'com.gradle.plugin-publish'
apply from: "${rootProject.projectDir}/gradle/integration-tests.gradle"
apply from: "${rootProject.projectDir}/gradle/license.gradle"
@ -93,8 +88,6 @@ subprojects {
dependsOn jar
}
install.dependsOn check
tasks.withType(Test) {
if (gradle.startParameter.isOffline()) {
systemProperties 'TESTS_ARE_OFFLINE': '1'

View File

@ -18,33 +18,19 @@ artifacts {
archives sourcesJar
}
bintray {
user = project.bintrayUser
key = project.bintrayKey
publish = true
dryRun = false
configurations = ['archives']
pkg {
userOrg = 'jruby-gradle'
repo = 'plugins'
name = 'jruby-gradle-core-plugin'
labels = ['jruby']
version {
name = project.version
vcsTag = "v${project.version}"
attributes = ['gradle-plugin': 'com.github.jruby-gradle.core:com.github.jruby-gradle:jruby-gradle-core-plugin']
desc = 'This plugin provides some core dependency resolution for JRuby/Gradle'
pluginBundle {
plugins {
gradlePlugin {
id = 'com.github.jruby-gradle.core'
displayName = 'JRuby/Gradle core plugin'
description = 'This plugin provides some core dependency resolution for JRuby/Gradle'
tags = (['jruby'])
}
}
}
processResources {
filesMatching '**/com.jrubygradle.core-plugin.version.properties', {
expand VERSION : project.version
}
}
bintrayUpload.dependsOn assemble

View File

@ -1,9 +1,7 @@
buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
gradlePluginPortal()
}
dependencies {
/* wow. so recursion */
@ -30,7 +28,7 @@ dependencies {
}
task prepareGroovyDocs(type: Copy) {
description "Copy Groovydocs into our site directory for deploybment/publication"
description "Copy Groovydocs into our site directory for deployment/publication"
into "${buildDir}/_site/groovydoc"
rootProject.subprojects.each {

View File

@ -87,32 +87,17 @@ artifacts {
archives sourcesJar
}
bintray {
user = project.bintrayUser
key = project.bintrayKey
publish = true
dryRun = false
configurations = ['archives']
pkg {
userOrg = 'jruby-gradle'
repo = 'plugins'
name = 'jruby-gradle-jar-plugin'
labels = ['jruby']
version {
name = project.version
vcsTag = "v${project.version}"
attributes = ['gradle-plugin' : 'com.github.jruby-gradle.jar:com.github.jruby-gradle:jruby-gradle-jar-plugin']
desc = 'This plugin encapsulates java archive building functionality for JRuby Gradle projects'
pluginBundle {
plugins {
gradlePlugin {
id = 'com.github.jruby-gradle.jar'
displayName = 'JRuby/Gradle base plugin'
description = 'This plugin encapsulates java archive building functionality for JRuby Gradle projects'
tags = (['jruby','fatjar'])
}
}
}
bintrayUpload {
dependsOn assemble
}
gradleTest {
dependsOn jar
mustRunAfter test, integrationTest

View File

@ -5,8 +5,8 @@ dependencies {
compile project(':jruby-gradle-plugin')
compile group: 'com.github.jruby-gradle', name: 'warbler-bootstrap', version: '0.2.0+'
testCompile (spockVersion) {
exclude module : 'groovy-all'
testCompile(spockVersion) {
exclude module: 'groovy-all'
}
}
@ -14,27 +14,15 @@ artifacts {
archives sourcesJar
}
bintray {
user = project.bintrayUser
key = project.bintrayKey
publish = true
dryRun = false
configurations = ['archives']
pkg {
userOrg = 'jruby-gradle'
repo = 'plugins'
name = 'jruby-gradle-war-plugin'
labels = ['jruby','war','java']
version {
name = project.version
vcsTag = "v${project.version}"
attributes = ['gradle-plugin' : 'com.github.jruby-gradle.war:com.github.jruby-gradle:jruby-gradle-war-plugin']
desc = project.description
pluginBundle {
plugins {
gradlePlugin {
id = 'com.github.jruby-gradle.jar'
displayName = 'JRuby/Gradle base plugin'
description = 'This plugin encapsulates building deployable WARs using JRuby'
tags = (['jruby', 'war'])
}
}
}
bintrayUpload.dependsOn assemble
// vim: ft=groovy