Skip to content

Commit

Permalink
(chore) ci: publish from main to GitHub Packages
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-pelykh committed Jun 19, 2024
1 parent 88c2ced commit 9741a14
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 12 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,9 @@ jobs:
- name: Run tests (Ubuntu)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: ./gradlew test -Dpcre2.library.path=/usr/lib/x86_64-linux-gnu

- name: Publish
if: ${{ matrix.os == 'ubuntu-latest' && matrix.java-distribution == 'temurin' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew publishAllPublicationsToGitHubPackagesRepository -Dpcre4j.version=main-SNAPSHOT
12 changes: 9 additions & 3 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,22 @@ publishing {
create<MavenPublication>("mavenJava") {
from(components["java"])

artifact(tasks.named("sourcesJar"))
artifact(tasks.named("javadocJar"))

groupId = "org.pcre4j"
artifactId = project.name
version = findProperty("pcre4j.version") as String? ?: "0.0.0-SNAPSHOT"
}
}

repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/" + System.getenv("GITHUB_REPOSITORY"))
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}

mavenCentral {
credentials {
username = findProperty("pcre4j.mavenCentral.user") as String? ?: ""
Expand Down
12 changes: 9 additions & 3 deletions ffm/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,22 @@ publishing {
create<MavenPublication>("mavenJava") {
from(components["java"])

artifact(tasks.named("sourcesJar"))
artifact(tasks.named("javadocJar"))

groupId = "org.pcre4j"
artifactId = project.name
version = findProperty("pcre4j.version") as String? ?: "0.0.0-SNAPSHOT"
}
}

repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/" + System.getenv("GITHUB_REPOSITORY"))
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}

mavenCentral {
credentials {
username = findProperty("pcre4j.mavenCentral.user") as String? ?: ""
Expand Down
12 changes: 9 additions & 3 deletions jna/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,22 @@ publishing {
create<MavenPublication>("mavenJava") {
from(components["java"])

artifact(tasks.named("sourcesJar"))
artifact(tasks.named("javadocJar"))

groupId = "org.pcre4j"
artifactId = project.name
version = findProperty("pcre4j.version") as String? ?: "0.0.0-SNAPSHOT"
}
}

repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/" + System.getenv("GITHUB_REPOSITORY"))
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}

mavenCentral {
credentials {
username = findProperty("pcre4j.mavenCentral.user") as String? ?: ""
Expand Down
12 changes: 9 additions & 3 deletions lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,22 @@ publishing {
create<MavenPublication>("mavenJava") {
from(components["java"])

artifact(tasks.named("sourcesJar"))
artifact(tasks.named("javadocJar"))

groupId = "org.pcre4j"
artifactId = project.name
version = findProperty("pcre4j.version") as String? ?: "0.0.0-SNAPSHOT"
}
}

repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/" + System.getenv("GITHUB_REPOSITORY"))
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}

mavenCentral {
credentials {
username = findProperty("pcre4j.mavenCentral.user") as String? ?: ""
Expand Down

0 comments on commit 9741a14

Please sign in to comment.