mirror of
https://github.com/BlueMap-Minecraft/BlueMapAPI.git
synced 2024-11-30 14:13:45 +01:00
Add github-packages publishing
This commit is contained in:
parent
92c438e099
commit
b359ec964c
4
.github/workflows/gradle.yml
vendored
4
.github/workflows/gradle.yml
vendored
@ -6,7 +6,7 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- name: Set up Java 11
|
- name: Set up Java 11
|
||||||
@ -14,7 +14,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
java-version: 11
|
java-version: 11
|
||||||
- name: Build with Gradle
|
- name: Build with Gradle
|
||||||
run: ./gradlew build
|
run: ./gradlew clean build test
|
||||||
- uses: actions/upload-artifact@v2-preview
|
- uses: actions/upload-artifact@v2-preview
|
||||||
with:
|
with:
|
||||||
name: artifact
|
name: artifact
|
||||||
|
22
.github/workflows/publish.yml
vendored
Normal file
22
.github/workflows/publish.yml
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
name: Java CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [ published ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
- name: Set up Java 11
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: 11
|
||||||
|
- name: Build with Gradle
|
||||||
|
env:
|
||||||
|
GITHUB_USERNAME: ${{ secrets.github.actor }}
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: ./gradlew clean build test publish
|
@ -3,6 +3,7 @@ import java.io.IOException
|
|||||||
plugins {
|
plugins {
|
||||||
java
|
java
|
||||||
`java-library`
|
`java-library`
|
||||||
|
`maven-publish`
|
||||||
id("com.diffplug.spotless") version "6.1.2"
|
id("com.diffplug.spotless") version "6.1.2"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,3 +89,23 @@ tasks.processResources {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
name = "GitHubPackages"
|
||||||
|
url = uri("https://maven.pkg.github.com/BlueMap-Minecraft/BlueMapAPI")
|
||||||
|
credentials {
|
||||||
|
username = project.findProperty("gpr.user") as String? ?: System.getenv("GITHUB_USERNAME")
|
||||||
|
password = project.findProperty("gpr.key") as String? ?: System.getenv("GITHUB_TOKEN")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
publications {
|
||||||
|
register<MavenPublication>("gpr") {
|
||||||
|
from(components["java"])
|
||||||
|
artifactId = "BlueMapAPI"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user