Skip to content

Commit 88fb49f

Browse files
committed
get ready for gradle plugin publishing
organize gradlePlugin block in build.gradle gradle version: 7.5.1 -> 7.6.1 github action add publish step
1 parent 60c6bdc commit 88fb49f

File tree

6 files changed

+22
-18
lines changed

6 files changed

+22
-18
lines changed

.github/workflows/gradle.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ jobs:
1515
runs-on: ubuntu-latest
1616

1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v3
1919
- name: Set up JDK 17
20-
uses: actions/setup-java@v2
20+
uses: actions/setup-java@v3
2121
with:
2222
distribution: 'temurin'
2323
java-version: 17
2424

2525
- name: Cache gradle files
26-
uses: actions/cache@v2
26+
uses: actions/cache@v3
2727
with:
2828
path: |
2929
~/.gradle/caches
@@ -35,14 +35,15 @@ jobs:
3535
3636
- name: Build with Gradle
3737
run: |
38-
echo GITHUB_RUN_ID $GITHUB_RUN_ID
39-
echo github.run_id ${{ github.run_id}}}
4038
chmod +x gradlew
4139
./gradlew build
42-
env:
43-
BUILD_ID: ${{ github.run_number }}
4440
45-
- uses: actions/upload-artifact@v2
41+
- uses: actions/upload-artifact@v3
4642
with:
4743
name: build-artifacts
4844
path: build/libs/
45+
46+
- name: Publish gradle plugin
47+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
48+
run: |
49+
./gradlew publishPlugins -Pgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }} -Pgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }}

build.gradle

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,16 @@ archivesBaseName = project.archives_base_name
2525
sourceCompatibility = JavaVersion.VERSION_1_8
2626
targetCompatibility = JavaVersion.VERSION_1_8
2727

28-
pluginBundle {
28+
gradlePlugin {
2929
website = 'https://github.com/Fallen-Breath/yamlang'
3030
vcsUrl = 'https://github.com/Fallen-Breath/yamlang'
31-
tags = ['Minecraft']
32-
}
33-
34-
gradlePlugin {
3531
plugins {
3632
yamlangPlugin {
3733
id = 'me.fallenbreath.yamlang'
3834
displayName = 'Yamlang'
3935
description = 'A gradle plugin to convert nestable yaml language file into plain json language file for Minecraft mods'
4036
implementationClass = 'me.fallenbreath.yamlang.YamlangPlugin'
37+
tags.set(['Minecraft', 'mod'])
4138
}
4239
}
4340
}

gradle/wrapper/gradle-wrapper.jar

818 Bytes
Binary file not shown.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
4+
networkTimeout=10000
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

gradlew

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
# Darwin, MinGW, and NonStop.
5656
#
5757
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
58+
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5959
# within the Gradle project.
6060
#
6161
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,10 +80,10 @@ do
8080
esac
8181
done
8282

83-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
84-
85-
APP_NAME="Gradle"
83+
# This is normally unused
84+
# shellcheck disable=SC2034
8685
APP_BASE_NAME=${0##*/}
86+
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
8787

8888
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
8989
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
@@ -143,12 +143,16 @@ fi
143143
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144144
case $MAX_FD in #(
145145
max*)
146+
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147+
# shellcheck disable=SC3045
146148
MAX_FD=$( ulimit -H -n ) ||
147149
warn "Could not query maximum file descriptor limit"
148150
esac
149151
case $MAX_FD in #(
150152
'' | soft) :;; #(
151153
*)
154+
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155+
# shellcheck disable=SC3045
152156
ulimit -n "$MAX_FD" ||
153157
warn "Could not set maximum file descriptor limit to $MAX_FD"
154158
esac

gradlew.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal
2626

2727
set DIRNAME=%~dp0
2828
if "%DIRNAME%"=="" set DIRNAME=.
29+
@rem This is normally unused
2930
set APP_BASE_NAME=%~n0
3031
set APP_HOME=%DIRNAME%
3132

0 commit comments

Comments
 (0)