Testing Github Packages

This commit is contained in:
Anuken
2022-05-10 19:43:47 -04:00
parent 8f31faa98e
commit 0169a925ef
3 changed files with 22 additions and 7 deletions

View File

@ -11,12 +11,14 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Set up JDK 16
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 16
java-version: 17
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Publish package
run: ./gradlew clean publish -PpackageVersion=${RELEASE_VERSION}
- name: Add Arc release
run: |
git clone --depth=1 --branch=master https://github.com/Anuken/Arc ../Arc

View File

@ -33,5 +33,7 @@ jobs:
git commit -m "Automatic bundle update"
git push
fi
- name: Publish package
run: ./gradlew clean publish -PpackageVersion=${GITHUB_SHA}
- name: Run unit tests
run: ./gradlew clean cleanTest test --stacktrace

View File

@ -30,7 +30,7 @@ plugins{
allprojects{
apply plugin: 'maven-publish'
version = 'release'
version = project.hasProperty("packageVersion") ? project.getProperty("packageVersion") : 'release'
group = 'com.github.Anuken'
ext{
@ -461,16 +461,27 @@ project(":annotations"){
}
}
configure([":core", ":desktop", ":server", ":tools"].collect{project(it)}){
configure([":core", ":server"].collect{project(it)}){
java{
withJavadocJar()
withSourcesJar()
}
publishing{
publications{
maven(MavenPublication){
from components.java
repositories{
maven{
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/anuken/mindustry")
credentials{
username = project.findProperty("gpr.user") ?: "Anuken"
password = project.findProperty("gpr.key") ?: System.getenv("PACKAGE_TOKEN")
}
}
}
publications {
gpr(MavenPublication) {
from(components.java)
}
}
}