From cd55639f45b4ad5e7c1edd51f5d1c1956f79b680 Mon Sep 17 00:00:00 2001 From: Rongmario Date: Thu, 15 Feb 2024 15:47:20 +0000 Subject: [PATCH] 2.0 release! Now on CleanroomMC's maven --- .github/workflows/publish.yml | 37 +++++++++++++++++++++++++++++++++++ build.gradle | 22 ++++++++++++++++++++- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..b09bb86 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,37 @@ +name: Publish + +on: + push: + tags: + - '[0-9]+.[0-9]+' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Grant Execute Permission for gradlew + run: chmod +x gradlew + + - name: Setup Java + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'zulu' + cache: gradle + + - name: Publish to Maven + uses: gradle/gradle-build-action@v2 + with: + arguments: | + publish + -PCleanroomMaven=${{ vars.CLEANROOM_MAVEN }} + -PCleanroomMavenUsername=${{ secrets.MAVEN_NAME }} + -PCleanroomMavenPassword=${{ secrets.MAVEN_PASSWORD }} + + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + path: build/libs/ diff --git a/build.gradle b/build.gradle index 51fff19..6d626c1 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,11 @@ plugins { id 'java' + id 'maven-publish' id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.7' } group 'zone.rong' -version '1.3' +version '2.0' tasks.withType(JavaExec).configureEach { jvmArgs '--add-opens=java.base/jdk.internal.reflect=ALL-UNNAMED' @@ -66,3 +67,22 @@ targetVendors.each { spec, info -> } } } + +publishing { + publications { + mavenJava(MavenPublication) { + from components.java + artifactId = 'imaginebreaker' + } + } + repositories { + maven { + name = 'CleanroomMaven' + url = CleanroomMaven + credentials(PasswordCredentials) + authentication { + basic(BasicAuthentication) + } + } + } +}