mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-19 15:09:25 +00:00
Publish API
This commit is contained in:
16
.github/workflows/build-1204.yml
vendored
16
.github/workflows/build-1204.yml
vendored
@@ -1,5 +1,9 @@
|
||||
name: Build Leaf 1.20.4
|
||||
on: [ push, pull_request ]
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "ver/1.20.4" ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -26,6 +30,14 @@ jobs:
|
||||
- name: Rename Paperclip Jar
|
||||
run: mv build/libs/leaf-paperclip-1.20.4-R0.1-SNAPSHOT-reobf.jar ./leaf-1.20.4.jar
|
||||
|
||||
- name: Publish API
|
||||
run: |
|
||||
echo "GITHUB_USERNAME=Leaf" >> $GITHUB_ENV
|
||||
export GITHUB_USERNAME=Leaf
|
||||
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
|
||||
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
|
||||
./gradlew :leaf-api:publish
|
||||
|
||||
- name: Upload Leaf
|
||||
uses: actions/upload-artifact@main
|
||||
with:
|
||||
@@ -33,7 +45,7 @@ jobs:
|
||||
path: ./leaf-1.20.4.jar
|
||||
|
||||
- name: Release Leaf
|
||||
if: github.ref_name == 'ver/1.20.4' && contains(github.event.commits[0].message, '[Release]')
|
||||
if: contains(github.event.commits[0].message, '[Release]')
|
||||
uses: marvinpinto/action-automatic-releases@master
|
||||
with:
|
||||
title: "Leaf 1.20.4"
|
||||
|
||||
37
.github/workflows/pr-1204.yml
vendored
Normal file
37
.github/workflows/pr-1204.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
name: Build Leaf 1.20.4 - Pull Request
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ "ver/1.20.4" ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@main
|
||||
- uses: gradle/wrapper-validation-action@main
|
||||
- name: Set up JDK
|
||||
uses: graalvm/setup-graalvm@main
|
||||
with:
|
||||
java-version: 17
|
||||
github-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
cache: gradle
|
||||
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Configure Git
|
||||
run: git config --global user.email "no-reply@github.com" && git config --global user.name "Github Actions"
|
||||
|
||||
- name: Apply patches
|
||||
run: ./gradlew -Dorg.gradle.jvmargs="-Dgraal.CompilerConfiguration=enterprise -Dgraal.UsePriorityInlining=true -Dgraal.Vectorization=true -Dgraal.OptDuplication=true --add-modules jdk.incubator.vector" applyPatches --stacktrace --no-daemon
|
||||
- name: Create ReobfPaperclipJar
|
||||
run: ./gradlew -Dorg.gradle.jvmargs="-Dgraal.CompilerConfiguration=enterprise -Dgraal.UsePriorityInlining=true -Dgraal.Vectorization=true -Dgraal.OptDuplication=true --add-modules jdk.incubator.vector" createReobfPaperclipJar --stacktrace --no-daemon
|
||||
|
||||
- name: Rename Paperclip Jar
|
||||
run: mv build/libs/leaf-paperclip-1.20.4-R0.1-SNAPSHOT-reobf.jar ./leaf-1.20.4.jar
|
||||
|
||||
- name: Upload Leaf
|
||||
uses: actions/upload-artifact@main
|
||||
with:
|
||||
name: Leaf 1.20.4
|
||||
path: ./leaf-1.20.4.jar
|
||||
@@ -84,14 +84,14 @@ paperweight {
|
||||
}
|
||||
}
|
||||
|
||||
// Dreeam TODO
|
||||
tasks.generateDevelopmentBundle {
|
||||
apiCoordinates = "io.github.dreeam-qwq:leaf-api"
|
||||
apiCoordinates = "org.dreeam.leaf:leaf-api"
|
||||
mojangApiCoordinates = "io.papermc.paper:paper-mojangapi"
|
||||
libraryRepositories.addAll(
|
||||
"https://repo.maven.apache.org/maven2/",
|
||||
paperMavenPublicUrl,
|
||||
"https://s01.oss.sonatype.org/content/repositories/snapshots/", // todo Remove when updating adventure to release
|
||||
libraryRepositories.set(
|
||||
listOf(
|
||||
"https://repo.maven.apache.org/maven2/",
|
||||
paperMavenPublicUrl,
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -108,9 +108,18 @@ publishing {
|
||||
allprojects {
|
||||
publishing {
|
||||
repositories {
|
||||
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") {
|
||||
maven {
|
||||
name = "leaf"
|
||||
credentials(PasswordCredentials::class)
|
||||
url = uri("https://maven.pkg.github.com/Winds-Studio/Leaf")
|
||||
|
||||
credentials.username = System.getenv("GITHUB_USERNAME")
|
||||
credentials.password = System.getenv("GITHUB_TOKEN")
|
||||
}
|
||||
|
||||
publications {
|
||||
register<MavenPublication>("gpr") {
|
||||
from(components["java"])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user