Skip to content

Commit

Permalink
fix: Gradle-publish (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
Benedetta-fabbri authored Nov 6, 2024
2 parents 0d09084 + 0afed32 commit 86c19c4
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/gradle-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
Expand All @@ -18,6 +21,9 @@ jobs:
with:
fetch-depth: 0

- name: Set permissions for Gradle Wrapper
run: chmod +x ./gradlew

- name: Setup Java
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 #v4.2.1
with:
Expand Down
28 changes: 26 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ plugins {
java
id("org.springframework.boot") version "3.3.5"
id("io.spring.dependency-management") version "1.1.6"
`java-library`
`maven-publish`
}

group = "it.gov.pagopa.payhub"
Expand Down Expand Up @@ -29,7 +31,7 @@ tasks.withType<Test> {
useJUnitPlatform()
}


apply(plugin = "maven-publish")

val janinoVersion = "3.1.12"
val wiremockVersion = "3.5.4"
Expand Down Expand Up @@ -83,4 +85,26 @@ configure<SourceSetContainer> {
named("main") {
java.srcDir("$projectDir/build/generated/src/main/java")
}
}
}

publishing {
publications {
create<MavenPublication>("github") {
from(components["java"])

groupId = project.group.toString()
artifactId = project.name
version = project.version.toString()
}
}
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/pagopa/p4pa-payhub-activities")
credentials {
username = System.getenv("USERNAME")
password = System.getenv("TOKEN")
}
}
}
}

0 comments on commit 86c19c4

Please sign in to comment.