From 66a940879190b6f78b52c009b670391c4695cb97 Mon Sep 17 00:00:00 2001 From: IzzelAliz Date: Thu, 8 Oct 2020 21:05:26 +0800 Subject: [PATCH] Update maven repo, bump 1.0.0 --- .github/workflows/gradle-publish.yml | 33 ++++++++++++++++++++++++++++ README.md | 2 +- build.gradle | 21 +++++++++++++++++- 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/gradle-publish.yml diff --git a/.github/workflows/gradle-publish.yml b/.github/workflows/gradle-publish.yml new file mode 100644 index 0000000..798510c --- /dev/null +++ b/.github/workflows/gradle-publish.yml @@ -0,0 +1,33 @@ +# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created +# For more information see: https://github.com/actions/setup-java#publishing-using-gradle + +name: Gradle Package + +on: + release: + types: [created] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + settings-path: ${{ github.workspace }} # location for the settings.xml file + + - name: Build with Gradle + run: gradle build + + # The USERNAME and TOKEN need to correspond to the credentials environment variables used in + # the publishing section of your build.gradle + - name: Publish to Maven + run: gradle publish + env: + USERNAME: ${{ secrets.NBT_CI_USER }} + TOKEN: ${{ secrets.NBT_CI_TOKEN }} diff --git a/README.md b/README.md index 62117ff..96a700a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Java NBT(Named Binary Tag) library. ```groovy repositories { - maven { url 'https://jitpack.io' } + maven { url 'https://maven.izzel.io/releases' } } dependencies { compile 'io.izzel:nbt:VERSION' diff --git a/build.gradle b/build.gradle index 222151e..398dbf5 100644 --- a/build.gradle +++ b/build.gradle @@ -1,9 +1,10 @@ plugins { id 'java' + id 'maven-publish' } group 'io.izzel' -version '1.0.0-SNAPSHOT' +version '1.0.0' repositories { mavenCentral() @@ -12,3 +13,21 @@ repositories { dependencies { testCompile group: 'junit', name: 'junit', version: '4.12' } + +publishing { + repositories { + maven { + name = "IzzelAliz" + url = uri("https://maven.izzel.io/releases") + credentials { + username = project.findProperty("gpr.user") ?: System.getenv("USERNAME") + password = project.findProperty("gpr.key") ?: System.getenv("TOKEN") + } + } + } + publications { + gpr(MavenPublication) { + from(components.java) + } + } +}