chore: add CI
Some checks failed
Maven release / build (push) Has been cancelled

This commit is contained in:
Ashhhleyyy 2024-03-12 20:20:19 +00:00
parent 54749a04d9
commit f82be6d14f
Signed by: ash
GPG key ID: 83B789081A0878FB
3 changed files with 50 additions and 3 deletions

View file

@ -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 }}

View file

@ -22,3 +22,24 @@ dependencies {
tasks.test {
useJUnitPlatform()
}
publishing {
publications.create<MavenPublication>("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()
}
}
}

View file

@ -1,2 +1 @@
rootProject.name = "bad-java"
rootProject.name = "bf"