diff --git a/.github/workflows/build-snapshot.yml b/.github/workflows/build-snapshot.yml new file mode 100644 index 0000000..2115ba6 --- /dev/null +++ b/.github/workflows/build-snapshot.yml @@ -0,0 +1,26 @@ +# Used when a commit is pushed to the repository +name: build-snapshot + +on: + push: + branches: + - main + +env: + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + MAVEN_SECRET: ${{ secrets.MAVEN_SECRET }} + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout sources + uses: actions/checkout@v4 + - name: Set up JDK + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 21 + - name: Build artifacts + run: ./gradlew build publish diff --git a/build.gradle b/build.gradle index 301d4e6..c3a8946 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,7 @@ plugins { id 'java-library' id 'com.github.johnrengelman.shadow' version '7.1.2' + id 'maven-publish' } allprojects { @@ -68,3 +69,24 @@ assemble.dependsOn shadowJar shadowJar { archiveClassifier.set('') } + +publishing { + publications { + shadow(MavenPublication) { + from components.shadow + } + } + repositories { + maven { + name = "taumcRepository" + url = uri("https://maven.taumc.org/releases") + credentials { + username = System.getenv("MAVEN_USERNAME") + password = System.getenv("MAVEN_SECRET") + } + authentication { + basic(BasicAuthentication) + } + } + } +}