test
This commit is contained in:
@@ -0,0 +1,51 @@
|
|||||||
|
name: Automate Gradlew Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up JDK 21
|
||||||
|
uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: "temurin"
|
||||||
|
java-version: "21"
|
||||||
|
check-latest: true
|
||||||
|
|
||||||
|
- name: Setup Gradle
|
||||||
|
uses: gradle/gradle-build-action@v3
|
||||||
|
|
||||||
|
- name: Read mod version
|
||||||
|
id: get_version
|
||||||
|
run: |
|
||||||
|
VERSION=$(grep '^mod_version' gradle.properties | head -n 1 | cut -d'=' -f2 | xargs)
|
||||||
|
echo "mod_version=${VERSION}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Grant execute permission for gradlew
|
||||||
|
run: chmod +x gradlew
|
||||||
|
|
||||||
|
- name: Build release JAR
|
||||||
|
run: ./gradlew clean build -x test --no-daemon --stacktrace
|
||||||
|
|
||||||
|
- name: Prepare release artifact
|
||||||
|
run: |
|
||||||
|
VERSION="${{ steps.get_version.outputs.mod_version }}"
|
||||||
|
mkdir -p build/release
|
||||||
|
# Source JAR should already be saturnclient-<version>.jar
|
||||||
|
cp "build/libs/saturnclient-${VERSION}.jar" "build/release/saturnclient-${VERSION}.jar"
|
||||||
|
|
||||||
|
- name: Upload build artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: "saturnclient-${{ steps.get_version.outputs.mod_version }}"
|
||||||
|
path: "build/release/saturnclient-${{ steps.get_version.outputs.mod_version }}.jar"
|
||||||
|
if-no-files-found: error
|
||||||
Reference in New Issue
Block a user