Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: gradle.yml
on:
push:
branches: [ "**" ]
pull_request:
branches: [ "**" ]
permissions:
contents: read
actions: read
checks: write
security-events: write

jobs:
build:
permissions: write-all

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
cache-disabled: true

- name: Log Gradle version
run: ./gradlew --version

- name: Publish Snapshot to Mauro Snapshot Repository
if: success() && github.ref == 'refs/heads/main'
env:
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_IN_MEMORY_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_IN_MEMORY_KEY_PASSWORD }}
run: |
./gradlew --stacktrace -PMauroSnapshotRepositoryUsername=${{secrets.MAURO_SNAPSHOT_REPOSITORY_USERNAME}} -PMauroSnapshotRepositoryPassword=${{secrets.MAURO_SNAPSHOT_REPOSITORY_PASSWORD}} publishAllPublicationsToMauroSnapshotRepositoryRepository
- name: Send a stream message
if: success() || failure()
uses: zulip/github-actions-zulip/send-message@v1
with:
api-key: ${{ secrets.ZULIP_API_KEY }}
email: "githubactionsbot-bot@maurodatamapper.zulipchat.com"
organization-url: "https://maurodatamapper.zulipchat.com"
to: "build/github-actions"
type: "stream"
topic: "${{github.repository}}"
content: "${{ job.status == 'success' && ':check_mark:' || ':cross_mark:' }} ${{github.repository}} : **${{github.ref}}**\nGitHub Actions build result: **${{ job.status }}**\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
14 changes: 14 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

tasks.register("publishAllToMavenLocal") {
dependsOn(
":plugin:publishToMavenLocal",
":cli:publishToMavenLocal"
)
}

tasks.register("publishAllPublicationsToMauroSnapshotRepositoryRepository") {
dependsOn(
":plugin:publishAllPublicationsToMauroSnapshotRepositoryRepository",
":cli:publishAllPublicationsToMauroSnapshotRepositoryRepository"
)
}
26 changes: 26 additions & 0 deletions cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ plugins {
id("groovy")
id("io.micronaut.application") version "4.6.1"
id("io.micronaut.aot") version "4.6.1"
id("com.gradleup.shadow") version "8.3.6"
id("maven-publish")
}

group = 'org.maurodata.plugins'
version = '0.0.1-SNAPSHOT'

repositories {
mavenLocal()
mavenCentral()
Expand Down Expand Up @@ -65,3 +69,25 @@ tasks.named("run", JavaExec) {
tasks.withType(Jar).configureEach {
archiveBaseName.set(rootProject.name+'-cli')
}

plugins.withId("maven-publish") {
publishing {
publications {
create("mavenJava", MavenPublication) {
from(components["java"])
artifactId = "${rootProject.name}-cli"
}
}

repositories {
maven {
name = "MauroSnapshotRepository"
url = "https://mauro-repository.com/libs-snapshot-local"
credentials(PasswordCredentials)
authentication {
basic(BasicAuthentication)
}
}
}
}
}
31 changes: 20 additions & 11 deletions plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id("groovy")
id("io.micronaut.library") version "4.6.1"
id("io.micronaut.aot") version "4.6.1"
id("com.gradleup.shadow") version "8.3.6"
id("maven-publish")
}

Expand Down Expand Up @@ -76,22 +77,30 @@ java {
targetCompatibility = JavaVersion.toVersion("17")
}

// Publish to the Mauro Snapshot Repository

tasks.withType(Jar).configureEach {
archiveBaseName.set(rootProject.name)
}

// TODO: Uncomment this to publish to the Mauro Snapshot Repository
/*
publishing {
repositories {
maven {
name = "MauroSnapshotRepository"
url = "https://mauro-repository.com/libs-snapshot-local"
credentials(PasswordCredentials)
authentication {
basic(BasicAuthentication)
plugins.withId("maven-publish") {
publishing {
publications {
create("mavenJava", MavenPublication) {
from(components["java"])
artifactId = "${rootProject.name}"
}
}

repositories {
maven {
name = "MauroSnapshotRepository"
url = "https://mauro-repository.com/libs-snapshot-local"
credentials(PasswordCredentials)
authentication {
basic(BasicAuthentication)
}
}
}
}
}
*/