Skip to content

Commit d4f6557

Browse files
committed
Added: Publish to the PvPHub Maven Repository
1 parent 7555079 commit d4f6557

File tree

3 files changed

+45
-54
lines changed

3 files changed

+45
-54
lines changed

.github/workflows/dev-build-release.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Gradle Package
2+
3+
on:
4+
push:
5+
branches: ["**"]
6+
pull_request:
7+
branches: ["**"]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v5
18+
19+
- name: Validate Gradle wrapper
20+
uses: gradle/actions/wrapper-validation@v5
21+
22+
- name: Set up JDK 21
23+
uses: actions/setup-java@v5
24+
with:
25+
java-version: "21"
26+
distribution: temurin
27+
cache: gradle
28+
29+
- name: Make Gradle wrapper executable
30+
run: chmod +x ./gradlew
31+
32+
- name: Build
33+
run: ./gradlew build
34+
35+
- name: Publish to PvPHub Maven (push to main only)
36+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
37+
env:
38+
PVPHUB_MAVEN_USERNAME: ${{ secrets.PVPHUB_MAVEN_USERNAME }}
39+
PVPHUB_MAVEN_SECRET: ${{ secrets.PVPHUB_MAVEN_SECRET }}
40+
run: ./gradlew publishAllPublicationsToPvphubMavenTofaaRepository

buildSrc/src/main/kotlin/entitylib.library-conventions.gradle.kts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ publishing {
5454
create<MavenPublication>("EntityLib") {
5555
groupId = project.group as String
5656
artifactId = project.name
57-
version = rootProject.ext["versionBeta"] as String
57+
version = rootProject.ext["versionNoHash"].toString()
5858
from(components["java"])
5959

6060
pom {
@@ -88,10 +88,11 @@ publishing {
8888

8989
repositories {
9090
maven {
91-
url = uri("https://central.sonatype.com/api/v1/publisher/upload")
91+
name = "pvphubMavenTofaa"
92+
url = uri("https://maven.pvphub.me/tofaa")
9293
credentials {
93-
username = System.getenv("OSSRH_USERNAME")
94-
password = System.getenv("OSSRH_PASSWORD")
94+
username = System.getenv("PVPHUB_MAVEN_USERNAME")
95+
password = System.getenv("PVPHUB_MAVEN_SECRET")
9596
}
9697
}
9798
}

0 commit comments

Comments
 (0)