Skip to content

Commit fc68016

Browse files
committed
1.2 - Fixing workflow
1 parent fc01cb6 commit fc68016

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

.github/workflows/publish.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
gradle-version: "8.11.1"
2929

3030
- name: Build with Gradle (Kotlin DSL)
31-
run: gradle --no-daemon clean shadowJar sourcesJar javadocJar
31+
run: gradle --no-daemon clean jar sourcesJar javadocJar
3232

3333
- name: Upload plugin artifact
3434
uses: actions/upload-artifact@v4
@@ -39,8 +39,11 @@ jobs:
3939
- name: Get Plugin Version
4040
id: version
4141
run: |
42-
JAR_PATH=$(ls build/libs/${{ github.event.repository.name }}-*.jar | grep -vE '(-sources|-javadoc).jar' | head -n 1)
43-
VERSION=$(basename "$JAR_PATH" .jar | sed "s/${{ github.event.repository.name }}-//")
42+
VERSION=$(gradle -q properties --property version | awk '/^version:/ {print $2}')
43+
if [ -z "$VERSION" ]; then
44+
echo "Could not determine project version"
45+
exit 1
46+
fi
4447
echo "VERSION=$VERSION" >> $GITHUB_ENV
4548
4649
- name: Delete existing GitHub release (if exists)
@@ -65,8 +68,7 @@ jobs:
6568

6669
- name: Rename & Upload Latest Release
6770
run: |
68-
JAR_FILE=$(ls build/libs/${{ github.event.repository.name }}-*.jar | grep -vE '(-sources|-javadoc).jar' | head -n 1)
69-
cp "$JAR_FILE" build/libs/${{ github.event.repository.name }}-latest.jar
71+
cp build/libs/${{ github.event.repository.name }}-${{ env.VERSION }}.jar build/libs/${{ github.event.repository.name }}-latest.jar
7072
7173
- name: Create GitHub Release
7274
uses: softprops/action-gh-release@v1

build.gradle.kts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2-
31
plugins {
42
kotlin("jvm") version "2.3.20-Beta1"
53
id("java-library")
@@ -62,14 +60,6 @@ tasks.withType<JavaCompile>().configureEach {
6260
options.compilerArgs.add("-Xlint:-options")
6361
}
6462

65-
tasks.withType<ShadowJar>().configureEach {
66-
exclude("META-INF/**")
67-
}
68-
69-
tasks.build {
70-
dependsOn("shadowJar")
71-
}
72-
7363
tasks.processResources {
7464
val props = mapOf("version" to version)
7565
inputs.properties(props)

0 commit comments

Comments
 (0)