Skip to content

Commit

Permalink
update publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredsburrows committed Apr 10, 2022
1 parent a0b5036 commit ce55fc1
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 174 deletions.
41 changes: 23 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: build

on: [push, pull_request]
on:
push:
branches:
- master
pull_request:
types: [ opened, labeled, unlabeled, synchronize ]

env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false"
Expand All @@ -17,8 +22,14 @@ jobs:
- 11

steps:
- name: Checkout Project
uses: actions/checkout@v3

- name: Validate Gradle Wrapper
uses: gradle/[email protected]

- name: Cache Gradle dependencies
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
Expand All @@ -27,23 +38,17 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle-

- name: Checkout Project
uses: actions/checkout@v2

- name: Validate Gradle Wrapper
uses: gradle/[email protected]

- name: Configure JDK
uses: actions/setup-java@v2.3.0
uses: actions/setup-java@v3.1.0
with:
distribution: 'adopt'
distribution: temurin
java-version: ${{ matrix.java-version }}

- name: Run Build
run: ./gradlew clean ktlintCheck build jar docsJar sourcesJar testsJar reportsZip publishMavenPublicationToMavenLocal -s
run: ./gradlew clean ktlintCheck build -s

- name: Upload Artifacts
uses: actions/upload-artifact@v2.2.4
uses: actions/upload-artifact@v3.0.0
if: always()
with:
name: gradle-license-plugin-${{ github.workflow }}-${{ github.run_id }}
Expand All @@ -64,19 +69,19 @@ jobs:

steps:
- name: Checkout Project
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Validate Gradle Wrapper
uses: gradle/[email protected]

- name: Configure JDK
uses: actions/setup-java@v2.3.0
uses: actions/setup-java@v3.1.0
with:
distribution: 'adopt'
distribution: temurin
java-version: 8

- name: Publish
run: ./gradlew clean publishMavenPublicationToMavenRepository -s
run: ./gradlew clean publish -s
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Gradle License Plugin

[![License](https://img.shields.io/badge/license-apache%202.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)
[![Build](https://github.com/jaredsburrows/gradle-license-plugin/workflows/build/badge.svg)](https://github.com/jaredsburrows/gradle-license-plugin/actions)
[![Build](https://github.com/jaredsburrows/gradle-license-plugin/actions/workflows/build.yml/badge.svg)](https://github.com/jaredsburrows/gradle-license-plugin/actions/workflows/build.yml)
[![Twitter Follow](https://img.shields.io/twitter/follow/jaredsburrows.svg?style=social)](https://twitter.com/jaredsburrows)

This plugin provides a task to generate a HTML license report based on the
Expand Down Expand Up @@ -252,17 +252,18 @@ Source: https://github.com/google/iosched/blob/2531cbdbe27e5795eb78bf47d27e8c1be
Source: https://www.bignerdranch.com/blog/open-source-licenses-and-android/

## License
```
Copyright (C) 2016 Jared Burrows
Copyright (C) 2016 Jared Burrows

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```
31 changes: 18 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter

plugins {
id 'org.jetbrains.kotlin.jvm' version '1.5.30'
id 'org.jetbrains.dokka' version '1.5.0'
id 'com.gradle.plugin-publish' version '0.15.0'
id 'org.jlleitschuh.gradle.ktlint' version '10.2.0'
id 'com.github.ben-manes.versions' version '0.39.0'
id 'org.jetbrains.kotlin.jvm' version '1.6.20'
id 'org.jetbrains.dokka' version '1.6.10'
id 'org.jlleitschuh.gradle.ktlint' version '10.2.1'
id 'com.vanniktech.maven.publish' version '0.18.0'
id 'com.gradle.plugin-publish' version '0.21.0'
id 'com.github.ben-manes.versions' version '0.42.0'
id 'java-gradle-plugin'
id 'java-library'
id 'groovy'
id 'maven-publish'
id 'signing'
}

repositories {
Expand Down Expand Up @@ -67,7 +66,14 @@ dependencies {
testImplementation deps.commons.csv
}

apply from: 'gradle/publish.gradle'
gradlePlugin {
plugins {
licensePlugin {
id = PLUGIN_NAME
implementationClass = PLUGIN_NAME_CLASS
}
}
}

tasks.withType(Jar).configureEach {
def dateFile = new File(buildDir, 'jar-manifest-date.txt')
Expand Down Expand Up @@ -102,8 +108,8 @@ tasks.withType(JavaCompile).configureEach {
targetCompatibility = rootProject.versions.java

configure(options) {
compilerArgs << '-Xlint:all' // Turn on all warnings
compilerArgs << '-Werror' // Turn warnings into errors
compilerArgs << '-Xlint:all'
compilerArgs << '-Xlint:-options'
encoding = 'utf-8'
}
}
Expand All @@ -113,16 +119,15 @@ tasks.withType(GroovyCompile).configureEach {
targetCompatibility = rootProject.versions.java

configure(options) {
compilerArgs << '-Xlint:all' // Turn on all warnings
compilerArgs << '-Werror' // Turn warnings into errors
compilerArgs << '-Xlint:all'
compilerArgs << '-Xlint:-options'
encoding = 'utf-8'
}
}

tasks.withType(Test).configureEach {
useJUnitPlatform()

// Turn on logging for all tests, filter to show failures/skips only
testLogging {
exceptionFormat 'full'
showCauses true
Expand Down
131 changes: 0 additions & 131 deletions gradle/publish.gradle

This file was deleted.

0 comments on commit ce55fc1

Please sign in to comment.