mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-30 21:17:53 +01:00
parent
8d117164f6
commit
11a7f02854
34
.github/workflows/pr.yml
vendored
34
.github/workflows/pr.yml
vendored
@ -26,7 +26,33 @@ jobs:
|
|||||||
# Ignore some of the paths when caching Maven Local repository
|
# Ignore some of the paths when caching Maven Local repository
|
||||||
maven-local-ignore-paths: |
|
maven-local-ignore-paths: |
|
||||||
net/minestom/
|
net/minestom/
|
||||||
- name: Build Minestom
|
# TODO: reenable
|
||||||
run: ./gradlew classes testClasses
|
# - name: Build Minestom
|
||||||
- name: Run Minestom tests
|
# run: ./gradlew classes testClasses
|
||||||
run: ./gradlew test
|
# - name: Run Minestom tests
|
||||||
|
# run: ./gradlew test
|
||||||
|
publish:
|
||||||
|
needs: [ build ]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
|
||||||
|
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
|
||||||
|
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||||
|
GPG_PASSPHRASE: ${{ secrets.GPG_PASSWORD }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up JDK 17
|
||||||
|
uses: actions/setup-java@v2
|
||||||
|
with:
|
||||||
|
java-version: '17'
|
||||||
|
distribution: 'temurin'
|
||||||
|
- name: Set outputs
|
||||||
|
id: vars
|
||||||
|
run: echo "short_commit_hash=${GITHUB_SHA::10}" >> $GITHUB_OUTPUT
|
||||||
|
- name: Publish to Sonatype
|
||||||
|
env:
|
||||||
|
MINESTOM_VERSION: ${{ github.head_ref }}-${{ steps.vars.outputs.short_commit_hash }}
|
||||||
|
MINESTOM_CHANNEL: snapshot
|
||||||
|
run: |
|
||||||
|
./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
|
||||||
|
echo "Version: ${SHORT_COMMIT_HASH}" >> $GITHUB_STEP_SUMMARY
|
||||||
|
@ -7,7 +7,9 @@ plugins {
|
|||||||
alias(libs.plugins.nexuspublish)
|
alias(libs.plugins.nexuspublish)
|
||||||
}
|
}
|
||||||
|
|
||||||
version = System.getenv("SHORT_COMMIT_HASH") ?: "dev"
|
// Read env vars (used for publishing generally)
|
||||||
|
version = System.getenv("MINESTOM_VERSION") ?: "dev"
|
||||||
|
var channel = System.getenv("MINESTOM_CHANNEL") ?: "local" // local, snapshot, release
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
apply(plugin = "java")
|
apply(plugin = "java")
|
||||||
@ -125,7 +127,8 @@ tasks {
|
|||||||
|
|
||||||
publishing.publications.create<MavenPublication>("maven") {
|
publishing.publications.create<MavenPublication>("maven") {
|
||||||
groupId = "net.minestom"
|
groupId = "net.minestom"
|
||||||
artifactId = "minestom-snapshots"
|
// todo: decide on publishing scheme
|
||||||
|
artifactId = if (channel == "snapshot") "minestom-snapshots" else "minestom-snapshots"
|
||||||
version = project.version.toString()
|
version = project.version.toString()
|
||||||
|
|
||||||
from(project.components["java"])
|
from(project.components["java"])
|
||||||
|
Loading…
Reference in New Issue
Block a user