Skip to content

Commit

Permalink
Update maven repo, bump 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
IzzelAliz committed Oct 8, 2020
1 parent 96d1af1 commit 66a9408
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 2 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/gradle-publish.yml
Original file line number Diff line number Diff line change
@@ -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 }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
21 changes: 20 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
plugins {
id 'java'
id 'maven-publish'
}

group 'io.izzel'
version '1.0.0-SNAPSHOT'
version '1.0.0'

repositories {
mavenCentral()
Expand All @@ -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)
}
}
}

0 comments on commit 66a9408

Please sign in to comment.