mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 16:16:17 +02:00
add small hash to actions name
This commit is contained in:
parent
71e0761476
commit
6347db9167
2 changed files with 13 additions and 25 deletions
16
.github/workflows/gradle.yml
vendored
16
.github/workflows/gradle.yml
vendored
|
|
@ -45,12 +45,10 @@ jobs:
|
||||||
run: chmod +x ./gradlew
|
run: chmod +x ./gradlew
|
||||||
|
|
||||||
- name: Get small commit hash
|
- name: Get small commit hash
|
||||||
run: echo "small_commit_hash=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV
|
run: echo "SMALL_COMMIT_HASH=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Build with Gradle Wrapper
|
- name: Build with Gradle Wrapper
|
||||||
run: ./gradlew build --parallel
|
run: ./gradlew build --parallel
|
||||||
env:
|
|
||||||
SMALL_COMMIT_HASH: ${{ env.small_commit_hash }}
|
|
||||||
|
|
||||||
# only submit dependency on push
|
# only submit dependency on push
|
||||||
- name: Generate and submit dependency graph
|
- name: Generate and submit dependency graph
|
||||||
|
|
@ -65,21 +63,21 @@ jobs:
|
||||||
ONLINE_JAR_PATH=$(ls build/libs/CustomAnvil-*.jar | grep -v "offline")
|
ONLINE_JAR_PATH=$(ls build/libs/CustomAnvil-*.jar | grep -v "offline")
|
||||||
OFFLINE_JAR_PATH=$(ls build/libs/CustomAnvil-*-offline.jar)
|
OFFLINE_JAR_PATH=$(ls build/libs/CustomAnvil-*-offline.jar)
|
||||||
|
|
||||||
echo "online_jar_name=$(basename $ONLINE_JAR_PATH)" >> $GITHUB_ENV
|
echo "ONLINE_JAR_NAME=$(basename $ONLINE_JAR_PATH)" >> $GITHUB_ENV
|
||||||
echo "offline_jar_name=$(basename $OFFLINE_JAR_PATH)" >> $GITHUB_ENV
|
echo "OFFLINE_JAR_NAME=$(basename $OFFLINE_JAR_PATH)" >> $GITHUB_ENV
|
||||||
|
|
||||||
# upload the named jars
|
# upload the named jars
|
||||||
- name: Upload online JAR artifact
|
- name: Upload online JAR artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.online_jar_name }}
|
name: ${{ env.ONLINE_JAR_NAME }}
|
||||||
path: build/libs/${{ env.online_jar_name }}
|
path: build/libs/${{ env.ONLINE_JAR_NAME }}
|
||||||
|
|
||||||
- name: Upload offline JAR file
|
- name: Upload offline JAR file
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ env.offline_jar_name }}
|
name: ${{ env.OFFLINE_JAR_NAME }}
|
||||||
path: build/libs/${{ env.offline_jar_name }}
|
path: build/libs/${{ env.OFFLINE_JAR_NAME }}
|
||||||
|
|
||||||
- name: Summarize tests results
|
- name: Summarize tests results
|
||||||
uses: jeantessier/test-summary-action@v1
|
uses: jeantessier/test-summary-action@v1
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ group = "xyz.alexcrea"
|
||||||
version = "1.11.3"
|
version = "1.11.3"
|
||||||
|
|
||||||
val effectiveVersion = "$version" +
|
val effectiveVersion = "$version" +
|
||||||
{ (if (System.getenv("SMALL_COMMIT_HASH") != null) "-${System.getenv("SMALL_COMMIT_HASH")!!}" else "") }
|
(if (System.getenv("SMALL_COMMIT_HASH") != null) "-dev-${System.getenv("SMALL_COMMIT_HASH")!!}" else "")
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
// EcoEnchants
|
// EcoEnchants
|
||||||
|
|
@ -134,24 +134,13 @@ allprojects {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fat-jar builder
|
|
||||||
val fatJar = tasks.register<Jar>("fatJar") {
|
|
||||||
manifest {
|
|
||||||
attributes.apply { put("Main-Class", "io.delilaheve.CustomAnvil") }
|
|
||||||
}
|
|
||||||
|
|
||||||
archiveFileName.set("${rootProject.name}-${effectiveVersion}.jar")
|
|
||||||
exclude("META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA")
|
|
||||||
duplicatesStrategy = DuplicatesStrategy.WARN
|
|
||||||
from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
|
|
||||||
with(tasks.jar.get() as CopySpec)
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
|
|
||||||
// Online jar (use of libraries)
|
// Online jar (use of libraries)
|
||||||
shadowJar {
|
shadowJar {
|
||||||
// No suffix for this jar
|
// No suffix for this jar
|
||||||
archiveClassifier.set("")
|
val name = "${rootProject.name}-${effectiveVersion}.jar"
|
||||||
|
archiveFileName.set(name)
|
||||||
|
|
||||||
// Exclude kotlin std and its annotation
|
// Exclude kotlin std and its annotation
|
||||||
exclude("**/kotlin-stdlib*.jar")
|
exclude("**/kotlin-stdlib*.jar")
|
||||||
|
|
@ -181,7 +170,8 @@ tasks {
|
||||||
|
|
||||||
// Add custom anvil compiled
|
// Add custom anvil compiled
|
||||||
::class, fun ShadowJar.() {
|
::class, fun ShadowJar.() {
|
||||||
archiveClassifier.set("offline")
|
val name = "${rootProject.name}-${effectiveVersion}-offline.jar"
|
||||||
|
archiveFileName.set(name)
|
||||||
|
|
||||||
// Shadow necessary dependency
|
// Shadow necessary dependency
|
||||||
relocate("com.github.stefvanschie.inventoryframework", "xyz.alexcrea.inventoryframework")
|
relocate("com.github.stefvanschie.inventoryframework", "xyz.alexcrea.inventoryframework")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue