Skip to content

fix: script sorting fix & error printing #69

fix: script sorting fix & error printing

fix: script sorting fix & error printing #69

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
name: Java CI with Gradle
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
# Only run on PRs if the source branch is on someone else's repo
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
runs-on: ubuntu-latest
steps:
- name: Checkout Git Repository
uses: actions/checkout@v4
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '21'
- name: Make Gradle Wrapper Executable
run: chmod +x ./gradlew
- name: Build
run: ./gradlew build --stacktrace --info
- name: Rename JARs if alpha
run: |
COMMIT_HASH=$(git rev-parse --short HEAD)
for file in outputs/*.jar; do
filename=$(basename "$file")
if [[ "$filename" =~ [Aa][Ll][Pp][Hh][Aa] ]]; then
base="${filename%.jar}"
newname="${base}-${COMMIT_HASH}.jar"
mv "$file" "outputs/$newname"
echo "Renamed $filename to $newname"
else
echo "No beta/alpha in $filename, skipping."
fi
done
- name: Capture Build Artifacts
uses: actions/upload-artifact@v4.6.0
with:
name: NeoBot-All
path: |
outputs/*.jar