-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish to Maven Central with static versions
Fixes #97
- Loading branch information
1 parent
bcb802c
commit 8f5d060
Showing
27 changed files
with
373 additions
and
457 deletions.
There are no files selected for viewing
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
jobs: | ||
ci: | ||
runs-on: ubuntu-latest | ||
env: | ||
GRADLE_OPTS: -Dorg.gradle.java.installations.fromEnv=JAVA_HOME_8_x64,JAVA_HOME_11_x64,JAVA_HOME_17_x64 | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Java 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: temurin | ||
java-version: 11 | ||
- name: Setup Java 17 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
|
||
- name: Validate Gradle Wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
- name: Gradle check | ||
run: ./gradlew check --continue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,33 @@ | ||
name: Release | ||
on: | ||
push: | ||
tags: | ||
- "*" | ||
tags: ["*"] | ||
jobs: | ||
check: | ||
release: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
java: [8, 11, 15] | ||
fail-fast: false | ||
steps: | ||
- name: "Checkout repo" | ||
uses: "actions/checkout@v2" | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: "Setup Java ${{ matrix.java }}" | ||
uses: "actions/setup-java@v1" | ||
with: | ||
java-version: ${{ matrix.java }} | ||
- name: "Validate Gradle Wrapper" | ||
uses: gradle/wrapper-validation-action@v1 | ||
- name: "Cache Gradle wrapper" | ||
uses: "actions/cache@v2" | ||
with: | ||
path: | | ||
~/.gradle/wrapper | ||
~/.gradle/notifications | ||
key: "gradle-wrapper-${{ runner.os }}-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}" | ||
- name: "Cache Gradle dependencies" | ||
uses: "actions/cache@v2" | ||
with: | ||
path: "~/.gradle/caches" | ||
key: "gradle-caches-${{ runner.os }}-${{ hashFiles('**/gradle/dependency-locks/*.lockfile') }}" | ||
- name: "Gradle check" | ||
run: "./gradlew check --continue" | ||
publish: | ||
runs-on: ubuntu-latest | ||
needs: check | ||
steps: | ||
- name: "Checkout repo" | ||
uses: "actions/checkout@v2" | ||
with: | ||
fetch-depth: 0 | ||
- name: "Setup Java" | ||
uses: "actions/setup-java@v1" | ||
with: | ||
java-version: 8 | ||
- name: "Cache Gradle wrapper" | ||
uses: "actions/cache@v2" | ||
with: | ||
path: | | ||
~/.gradle/wrapper | ||
~/.gradle/notifications | ||
key: "gradle-wrapper-${{ runner.os }}-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}" | ||
- name: "Cache Gradle dependencies" | ||
uses: "actions/cache@v2" | ||
with: | ||
path: "~/.gradle/caches" | ||
key: "gradle-caches-${{ runner.os }}-${{ hashFiles('**/gradle/dependency-locks/*.lockfile') }}" | ||
- name: "Gradle publish" | ||
- name: Setup Java 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: zulu | ||
java-version: 11 | ||
- name: Setup Java 17 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: zulu | ||
java-version: 17 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
- name: Gradle publish | ||
env: | ||
BINTRAY_USER: ${{ secrets.BINTRAY_USER }} | ||
BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }} | ||
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | ||
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | ||
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.PGP_SIGNING_KEY }} | ||
ORG_GRADLE_PROJECT_signingPassphrase: ${{ secrets.PGP_SIGNING_PASSPHRASE }} | ||
GRADLE_OPTS: "-Dorg.gradle.project.gradle.publish.key=${{ secrets.GRADLE_PLUGIN_KEY }} -Dorg.gradle.project.gradle.publish.secret=${{ secrets.GRADLE_PLUGIN_SECRET }}" | ||
run: "./gradlew publish publishPlugins" | ||
run: ./gradlew publishAllPublicationsToCentralReleasesRepository |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
plugins { | ||
id("org.ajoberstar.defaults.gradle-plugin") | ||
groovy | ||
|
||
id("org.ajoberstar.stutter") | ||
id("org.ajoberstar.grgit") | ||
id("org.ajoberstar.reckon") | ||
} | ||
|
||
group = "org.ajoberstar.git-publish" | ||
description = "Gradle plugin for publishing to Git repositories" | ||
|
||
reckon { | ||
scopeFromProp() | ||
stageFromProp("beta", "rc", "final") | ||
} | ||
|
||
mavenCentral { | ||
developerName.set("Andrew Oberstar") | ||
developerEmail.set("ajoberstar@gmail.com") | ||
githubOwner.set("ajoberstar") | ||
githubRepository.set("reckon") | ||
} | ||
|
||
java { | ||
toolchain { | ||
languageVersion.set(JavaLanguageVersion.of(8)) | ||
} | ||
} | ||
|
||
dependencies { | ||
// grgit | ||
api("org.ajoberstar.grgit:grgit-core:[4.0,5.0[") | ||
compatTestImplementation("org.ajoberstar.grgit:grgit-core:[4.0,5.0[") | ||
|
||
// testing | ||
compatTestImplementation(gradleTestKit()) | ||
compatTestImplementation("org.spockframework:spock-core:2.0-groovy-3.0") | ||
} | ||
|
||
tasks.named<Jar>("jar") { | ||
manifest { | ||
attributes.put("Automatic-Module-Name", "org.ajoberstar.git.publish.gradle") | ||
} | ||
} | ||
|
||
tasks.withType<Test> { | ||
useJUnitPlatform() | ||
} | ||
|
||
stutter { | ||
val java8 by matrices.creating { | ||
javaToolchain { | ||
languageVersion.set(JavaLanguageVersion.of(8)) | ||
} | ||
gradleVersions { | ||
compatibleRange("5.0") | ||
} | ||
} | ||
val java11 by matrices.creating { | ||
javaToolchain { | ||
languageVersion.set(JavaLanguageVersion.of(11)) | ||
} | ||
gradleVersions { | ||
compatibleRange("5.0") | ||
} | ||
} | ||
val java17 by matrices.creating { | ||
javaToolchain { | ||
languageVersion.set(JavaLanguageVersion.of(17)) | ||
} | ||
gradleVersions { | ||
compatibleRange("7.3") | ||
} | ||
} | ||
} | ||
|
||
tasks.named("check") { | ||
dependsOn(tasks.named("compatTest")) | ||
} | ||
|
||
gradlePlugin { | ||
plugins { | ||
create("plugin") { | ||
id = "org.ajoberstar.git-publish" | ||
displayName = "Git Publish Plugin" | ||
description = "Gradle plugin for publishing to Git repositories" | ||
implementationClass = "org.ajoberstar.gradle.git.publish.GitPublishPlugin" | ||
} | ||
} | ||
} |
Oops, something went wrong.