diff --git a/.forgejo/workflows/publish.yml b/.forgejo/workflows/publish.yml new file mode 100644 index 0000000..83c5532 --- /dev/null +++ b/.forgejo/workflows/publish.yml @@ -0,0 +1,27 @@ +name: Maven release + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK + uses: github.com/actions/setup-java@v1 + with: + java-version: 17 + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - name: Build and publish with gradle + uses: github.com/gradle/gradle-build-action@v2 + with: + arguments: publish + env: + MAVEN_URL: ${{ secrets.MAVEN_URL }} + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} diff --git a/build.gradle.kts b/build.gradle.kts index 970d5a8..fcb227e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -21,4 +21,25 @@ dependencies { tasks.test { useJUnitPlatform() -} \ No newline at end of file +} + +publishing { + publications.create("maven") { + from(components["java"]) + } + + repositories { + if (System.getenv("MAVEN_URL") != null) { + maven { + name = "ashhhleyyy" + setUrl(System.getenv("MAVEN_URL")) + credentials { + username = System.getenv("MAVEN_USERNAME") + password = System.getenv("MAVEN_PASSWORD") + } + } + } else { + mavenLocal() + } + } +} diff --git a/settings.gradle.kts b/settings.gradle.kts index dc8c68b..684f417 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,2 +1 @@ -rootProject.name = "bad-java" - +rootProject.name = "bf"