Skip to content

Commit

Permalink
Setup maven publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
embeddedt committed Oct 19, 2024
1 parent 0521c68 commit 27dc6b4
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 3 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Used when a commit is pushed to the repository
name: build-snapshot

on: [ push ]

env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_SECRET: ${{ secrets.MAVEN_SECRET }}

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Extract current branch name
shell: bash
# bash pattern expansion to grab branch name without slashes
run: ref="${GITHUB_REF#refs/heads/}" && echo "branch=${ref////-}" >> $GITHUB_OUTPUT
id: ref
- 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
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Taufuscator
path: build/libs
25 changes: 22 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'antlr'
id 'java-library'
id 'maven-publish'
}

group = 'org.taumc'
Expand All @@ -18,15 +19,33 @@ dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter'
}



generateGrammarSource {
arguments += ["-visitor", '-package', 'org.taumc.glsl.grammar']
outputDirectory = new File(buildDir.toString() + "/generated-src/antlr/main/org/taumc/glsl/grammar/")

}


test {
useJUnitPlatform()
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
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)
}
}
}
}

0 comments on commit 27dc6b4

Please sign in to comment.