Skip to content

Commit

Permalink
maven?
Browse files Browse the repository at this point in the history
  • Loading branch information
gigabit101 committed Aug 22, 2023
1 parent 4b74afd commit c46eda4
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 13 deletions.
21 changes: 8 additions & 13 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,20 @@ name: Java CI with Gradle

on:
push:
branches: [ 1.18.2, 1.20.1 ]
pull_request:
branches: [ 1.18.2 ]

branches: [ 1.20.1 ]
jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 16
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '16'
java-version: '17'
distribution: 'temurin'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7
with:
arguments: build
env:
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN}}
run: |
chmod +x ./gradlew
./gradlew build publish --stacktrace --no-daemon
23 changes: 23 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,29 @@ jar {
}
}

def ENV = System.getenv()

publishing {
publications {
register('mavenJava', MavenPublication) {
groupId "net.gigabit101"
artifactId = rootProject.archivesBaseName
from components.java
}
}
repositories {
if (ENV.MAVEN_TOKEN) {
maven {
url "https://maven.creeperhost.net/release"
credentials {
username = "Gigabit101"
password = "${ENV.MAVEN_TOKEN}"
}
}
}
}
}

tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}

0 comments on commit c46eda4

Please sign in to comment.