-
-
Notifications
You must be signed in to change notification settings - Fork 496
Update to gradle and latest runelite #1630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d41ef92
d2c9928
5d0e20b
22fa420
76941a5
5c691c1
107ec11
39e8335
64a3076
68fcb41
9ef28b2
2e632bb
05f608e
ada6ec1
d709788
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,9 +4,6 @@ on: | |||||||||||||||||||||||||||||||||
| schedule: | ||||||||||||||||||||||||||||||||||
| - cron: "0 0 * * *" | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||||
| version: ${microbot.version} | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||
| build: | ||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest # You can choose a different runner if needed | ||||||||||||||||||||||||||||||||||
|
|
@@ -31,24 +28,30 @@ jobs: | |||||||||||||||||||||||||||||||||
| distribution: temurin | ||||||||||||||||||||||||||||||||||
| java-version: 11 | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Setup Gradle | ||||||||||||||||||||||||||||||||||
| uses: gradle/actions/setup-gradle@v4 | ||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||
| gradle-version: wrapper | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Build Shaded JAR | ||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||
| COMMIT_SHA=$(git rev-parse --short HEAD) | ||||||||||||||||||||||||||||||||||
| mvn clean package -Dmicrobot.commit.sha=$COMMIT_SHA | ||||||||||||||||||||||||||||||||||
| ./gradlew :runelite-client:shadowJar -Pmicrobot.commit.sha=$COMMIT_SHA | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Read microbot.version from POM | ||||||||||||||||||||||||||||||||||
| - name: Read microbot.version from Gradle | ||||||||||||||||||||||||||||||||||
| id: version | ||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||
| V=$(mvn -q -f runelite-client/pom.xml help:evaluate \ | ||||||||||||||||||||||||||||||||||
| -Dexpression=microbot.version -DforceStdout) | ||||||||||||||||||||||||||||||||||
| # fallback to project.version if the property isn't defined | ||||||||||||||||||||||||||||||||||
| if [ -z "$V" ]; then | ||||||||||||||||||||||||||||||||||
| V=$(mvn -q -f runelite-client/pom.xml help:evaluate \ | ||||||||||||||||||||||||||||||||||
| -Dexpression=project.version -DforceStdout) | ||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||
| V=$(./gradlew -q properties --console=plain | sed -n 's/^microbot.version: //p') | ||||||||||||||||||||||||||||||||||
| if [ -z "$V" ]; then V=$(grep '^microbot.version=' gradle.properties | cut -d= -f2); fi | ||||||||||||||||||||||||||||||||||
| echo "version=$V" >> "$GITHUB_OUTPUT" | ||||||||||||||||||||||||||||||||||
| echo "Using version: $V" | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Prepare artifact name | ||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||
| SRC=$(echo runelite-client/build/libs/client-*-shaded.jar) | ||||||||||||||||||||||||||||||||||
| DEST=runelite-client/build/libs/microbot-${{ steps.version.outputs.version }}.jar | ||||||||||||||||||||||||||||||||||
| cp "$SRC" "$DEST" | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+49
to
+53
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Glob may match multiple files or none, causing silent misbehavior. The 🔎 Suggested hardening - name: Prepare artifact name
run: |
- SRC=$(echo runelite-client/build/libs/client-*-shaded.jar)
+ shopt -s nullglob
+ FILES=(runelite-client/build/libs/client-*-shaded.jar)
+ if [ "${#FILES[@]}" -ne 1 ]; then
+ echo "Expected exactly 1 shaded jar, found ${#FILES[@]}" >&2
+ exit 1
+ fi
+ SRC="${FILES[0]}"
DEST=runelite-client/build/libs/microbot-${{ steps.version.outputs.version }}.jar
cp "$SRC" "$DEST"📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Create Release | ||||||||||||||||||||||||||||||||||
| uses: "marvinpinto/action-automatic-releases@latest" | ||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||
|
|
@@ -57,15 +60,15 @@ jobs: | |||||||||||||||||||||||||||||||||
| prerelease: false | ||||||||||||||||||||||||||||||||||
| title: "Nightly Build" | ||||||||||||||||||||||||||||||||||
| files: | | ||||||||||||||||||||||||||||||||||
| /home/runner/work/Microbot/Microbot/runelite-client/target/microbot-*.jar | ||||||||||||||||||||||||||||||||||
| /home/runner/work/Microbot/Microbot/runelite-client/build/libs/microbot-*.jar | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Upload Jar to Hetzner | ||||||||||||||||||||||||||||||||||
| uses: appleboy/scp-action@v0.1.7 | ||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||
| host: ${{ secrets.PROD_HOST }} | ||||||||||||||||||||||||||||||||||
| username: root | ||||||||||||||||||||||||||||||||||
| key: ${{ secrets.PROD_SSH_KEY }} | ||||||||||||||||||||||||||||||||||
| source: runelite-client/target/microbot-*.jar | ||||||||||||||||||||||||||||||||||
| source: runelite-client/build/libs/microbot-*.jar | ||||||||||||||||||||||||||||||||||
| target: /var/www/files/releases/microbot/nightly/ | ||||||||||||||||||||||||||||||||||
| strip_components: 2 | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
|
@@ -85,4 +88,4 @@ jobs: | |||||||||||||||||||||||||||||||||
| EOL | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Deploy to Nexus | ||||||||||||||||||||||||||||||||||
| run: mvn deploy:deploy-file -DgroupId=com.microbot -DartifactId=client -Dversion=${{ steps.version.outputs.version }} -Dpackaging=jar -Dfile=runelite-client/target/microbot-${{ steps.version.outputs.version }}.jar -DrepositoryId=microbot-nightly -Durl=https://nexus.microbot.cloud/repository/microbot-nightly/ | ||||||||||||||||||||||||||||||||||
| run: mvn deploy:deploy-file -DgroupId=com.microbot -DartifactId=client -Dversion=${{ steps.version.outputs.version }} -Dpackaging=jar -Dfile=runelite-client/build/libs/microbot-${{ steps.version.outputs.version }}.jar -DrepositoryId=microbot-nightly -Durl=https://nexus.microbot.cloud/repository/microbot-nightly/ | ||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,9 +4,6 @@ on: | |
| branches: | ||
| - main | ||
|
|
||
| env: | ||
| version: ${microbot.version} | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest # You can choose a different runner if needed | ||
|
|
@@ -23,25 +20,31 @@ jobs: | |
| distribution: temurin | ||
| java-version: 11 | ||
|
|
||
| - name: Setup Gradle | ||
| uses: gradle/actions/setup-gradle@v4 | ||
| with: | ||
| gradle-version: wrapper | ||
|
|
||
| - name: Build Shaded JAR | ||
| run: | | ||
| COMMIT_SHA=$(git rev-parse --short HEAD) | ||
| mvn clean package -Dmicrobot.commit.sha=$COMMIT_SHA | ||
| ./gradlew :runelite-client:shadowJar -Pmicrobot.commit.sha=$COMMIT_SHA | ||
|
|
||
|
|
||
| - name: Read microbot.version from POM | ||
| - name: Read microbot.version from Gradle | ||
| id: version | ||
| run: | | ||
| V=$(mvn -q -f runelite-client/pom.xml help:evaluate \ | ||
| -Dexpression=microbot.version -DforceStdout) | ||
| # fallback to project.version if the property isn't defined | ||
| if [ -z "$V" ]; then | ||
| V=$(mvn -q -f runelite-client/pom.xml help:evaluate \ | ||
| -Dexpression=project.version -DforceStdout) | ||
| fi | ||
| V=$(./gradlew -q properties --console=plain | sed -n 's/^microbot.version: //p') | ||
| if [ -z "$V" ]; then V=$(grep '^microbot.version=' gradle.properties | cut -d= -f2); fi | ||
| echo "version=$V" >> "$GITHUB_OUTPUT" | ||
| echo "Using version: $V" | ||
|
|
||
| - name: Prepare artifact name | ||
| run: | | ||
| SRC=$(echo runelite-client/build/libs/client-*-shaded.jar) | ||
| DEST=runelite-client/build/libs/microbot-${{ steps.version.outputs.version }}.jar | ||
| cp "$SRC" "$DEST" | ||
|
Comment on lines
+42
to
+46
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same glob assumption issue as in nightly.yml. The 🤖 Prompt for AI Agents |
||
|
|
||
| - name: Create Release | ||
| uses: "marvinpinto/action-automatic-releases@latest" | ||
| with: | ||
|
|
@@ -50,15 +53,15 @@ jobs: | |
| prerelease: false | ||
| title: "Release ${{ steps.version.outputs.version }}" | ||
| files: | | ||
| /home/runner/work/Microbot/Microbot/runelite-client/target/microbot-*.jar | ||
| /home/runner/work/Microbot/Microbot/runelite-client/build/libs/microbot-*.jar | ||
|
|
||
| - name: Upload Jar to Hetzner | ||
| uses: appleboy/scp-action@v0.1.7 | ||
| with: | ||
| host: ${{ secrets.PROD_HOST }} | ||
| username: root | ||
| key: ${{ secrets.PROD_SSH_KEY }} | ||
| source: runelite-client/target/microbot-*.jar | ||
| source: runelite-client/build/libs/microbot-*.jar | ||
| target: /var/www/files/releases/microbot/stable/ | ||
| strip_components: 2 | ||
|
|
||
|
|
@@ -78,7 +81,7 @@ jobs: | |
| EOL | ||
|
|
||
| - name: Deploy to Nexus | ||
| run: mvn deploy:deploy-file -DgroupId=com.microbot -DartifactId=client -Dversion=${{ steps.version.outputs.version }} -Dpackaging=jar -Dfile=runelite-client/target/microbot-${{ steps.version.outputs.version }}.jar -DrepositoryId=microbot-release -Durl=https://nexus.microbot.cloud/repository/microbot-release/ | ||
| run: mvn deploy:deploy-file -DgroupId=com.microbot -DartifactId=client -Dversion=${{ steps.version.outputs.version }} -Dpackaging=jar -Dfile=runelite-client/build/libs/microbot-${{ steps.version.outputs.version }}.jar -DrepositoryId=microbot-release -Durl=https://nexus.microbot.cloud/repository/microbot-release/ | ||
|
|
||
| - name: Get Auth Token | ||
| id: auth | ||
|
|
@@ -96,4 +99,4 @@ jobs: | |
| -H "Authorization: Bearer ${{ steps.auth.outputs.token }}" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d "{\"version\":\"${{ steps.version.outputs.version }}\"}" \ | ||
| https://microbot.cloud/api/version/client | ||
| https://microbot.cloud/api/version/client | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,40 @@ | ||
| target | ||
| nbactions.xml | ||
| nb-configuration.xml | ||
| /nbproject/ | ||
| project.properties | ||
| *.iml | ||
| .gradle | ||
| build/ | ||
| !gradle/wrapper/gradle-wrapper.jar | ||
| !**/src/main/**/build/ | ||
| !**/src/test/**/build/ | ||
|
|
||
| ### IntelliJ IDEA ### | ||
| .idea/ | ||
| .project | ||
| .settings/ | ||
| *.iws | ||
| *.iml | ||
| *.ipr | ||
| out/ | ||
| !**/src/main/**/out/ | ||
| !**/src/test/**/out/ | ||
|
|
||
| ### Eclipse ### | ||
| .apt_generated | ||
| .classpath | ||
| .vscode | ||
| .factorypath | ||
| .project | ||
| .settings | ||
| .springBeans | ||
| .sts4-cache | ||
| bin/ | ||
| !**/src/main/**/bin/ | ||
| !**/src/test/**/bin/ | ||
|
|
||
| ### NetBeans ### | ||
| /nbproject/private/ | ||
| /nbbuild/ | ||
| /dist/ | ||
| /nbdist/ | ||
| /.nb-gradle/ | ||
|
|
||
| ### VS Code ### | ||
| .vscode/ | ||
|
|
||
| ### Mac OS ### | ||
| .DS_Store | ||
| /docs/diff.txt | ||
| /sqllite.pom.patch | ||
| /debug_temp_version.txt | ||
| /tordemon.patch | ||
| /commit.ps1 | ||
| /runelite-client_part1.txt | ||
| /commit_overview.txt | ||
| /runelite-client_part2.txt | ||
| /unnamed.patch | ||
| /sqllite.patch | ||
| /runelite-client_part3.txt | ||
| /hs_err_pid44304.log | ||
| /commit_overview.html | ||
| /commits.html | ||
| /runelite-client_part4.txt | ||
| /runelite-client_part5.txt | ||
| /cache/target/* |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| /* | ||
| * Copyright (c) 2024, LlemonDuck <napkinorton@gmail.com> | ||
| * All rights reserved. | ||
| * | ||
| * Redistribution and use in source and binary forms, with or without | ||
| * modification, are permitted provided that the following conditions are met: | ||
| * | ||
| * 1. Redistributions of source code must retain the above copyright notice, this | ||
| * list of conditions and the following disclaimer. | ||
| * 2. Redistributions in binary form must reproduce the above copyright notice, | ||
| * this list of conditions and the following disclaimer in the documentation | ||
| * and/or other materials provided with the distribution. | ||
| * | ||
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
| * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
| * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
| * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
| * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
| * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
| * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
| * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
| * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| */ | ||
|
|
||
| tasks.register("cleanAll") { | ||
| gradle.includedBuilds.forEach { build -> this@register.dependsOn(build.task(":clean")) } | ||
| } | ||
| tasks.register("buildAll") { | ||
| gradle.includedBuilds.forEach { build -> this@register.dependsOn(build.task(":build")) } | ||
| } | ||
| tasks.register("assembleAll") { | ||
| gradle.includedBuilds.forEach { build -> this@register.dependsOn(build.task(":assemble")) } | ||
| } | ||
| tasks.register("testAll") { | ||
| gradle.includedBuilds.forEach { build -> this@register.dependsOn(build.task(":test")) } | ||
| } | ||
| tasks.register("publishAll") { | ||
| this@register.dependsOn(gradle.includedBuild("cache").task(":publish")) | ||
| this@register.dependsOn(gradle.includedBuild("runelite-api").task(":publish")) | ||
| this@register.dependsOn(gradle.includedBuild("runelite-client").task(":publish")) | ||
| this@register.dependsOn(gradle.includedBuild("runelite-jshell").task(":publish")) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent glob handling for artifact preparation.
The
SRCvariable uses glob expansion viaecho, but the subsequentcpcommand expects exactly one file. If the glob matches zero or multiple files, the copy will fail silently or incorrectly.🔎 Proposed fix
- name: Prepare artifact name run: | - SRC=$(echo runelite-client/build/libs/client-*-shaded.jar) + SRC=$(ls runelite-client/build/libs/client-*-shaded.jar 2>/dev/null | head -n1) + if [ -z "$SRC" ]; then echo "No shaded JAR found"; exit 1; fi DEST=runelite-client/build/libs/microbot-${{ steps.version.outputs.version }}.jar cp "$SRC" "$DEST"📝 Committable suggestion
🤖 Prompt for AI Agents