This commit is contained in:
parent
54749a04d9
commit
f82be6d14f
3 changed files with 50 additions and 3 deletions
27
.forgejo/workflows/publish.yml
Normal file
27
.forgejo/workflows/publish.yml
Normal 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 }}
|
|
@ -21,4 +21,25 @@ 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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
rootProject.name = "bad-java"
|
||||
|
||||
rootProject.name = "bf"
|
||||
|
|
Loading…
Reference in a new issue