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: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up JDK 16 - name: Set up JDK 17
uses: actions/setup-java@v1 uses: actions/setup-java@v1
with: with:
java-version: 16 java-version: 17
- name: Set env - name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Publish package
run: ./gradlew clean publish -PpackageVersion=${RELEASE_VERSION}
- name: Add Arc release - name: Add Arc release
run: | run: |
git clone --depth=1 --branch=master https://github.com/Anuken/Arc ../Arc 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 commit -m "Automatic bundle update"
git push git push
fi fi
- name: Publish package
run: ./gradlew clean publish -PpackageVersion=${GITHUB_SHA}
- name: Run unit tests - name: Run unit tests
run: ./gradlew clean cleanTest test --stacktrace run: ./gradlew clean cleanTest test --stacktrace

View File

@ -30,7 +30,7 @@ plugins{
allprojects{ allprojects{
apply plugin: 'maven-publish' apply plugin: 'maven-publish'
version = 'release' version = project.hasProperty("packageVersion") ? project.getProperty("packageVersion") : 'release'
group = 'com.github.Anuken' group = 'com.github.Anuken'
ext{ ext{
@ -461,16 +461,27 @@ project(":annotations"){
} }
} }
configure([":core", ":desktop", ":server", ":tools"].collect{project(it)}){ configure([":core", ":server"].collect{project(it)}){
java{ java{
withJavadocJar() withJavadocJar()
withSourcesJar() withSourcesJar()
} }
publishing{ publishing{
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 { publications {
maven(MavenPublication){ gpr(MavenPublication) {
from components.java from(components.java)
} }
} }
} }