diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 0000000..1968d26 --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,45 @@ +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: Set up Gradle + uses: gradle/actions/setup-gradle@v3 + with: + gradle-home-cache-cleanup: false + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build (release) + run: ./gradlew clean build -x test --no-daemon --stacktrace + + - name: Remove sources JARs + run: | + rm -f build/libs/*sources*.jar + echo "Removed sources JARs from build/libs" + + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: saturnclient-latest + path: build/libs/saturnclient-*.jar + if-no-files-found: error diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 0000000..5016b03 --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,52 @@ +name: Push Builds + +on: + push: + branches: [ "master" ] + +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" + + - name: Set up Gradle + uses: gradle/actions/setup-gradle@v3 + with: + gradle-home-cache-cleanup: false + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Build + run: ./gradlew clean build -x test --no-daemon --stacktrace + + - name: Remove sources JARs + run: | + rm -f build/libs/*sources*.jar + echo "Removed sources JARs from build/libs" + + - name: Create timestamped JAR + run: | + TIMESTAMP=$(date -u +"%Y%m%d-%H%M%S") + MAIN_JAR=$(ls build/libs/saturnclient-*.jar | head -1) + cp "$MAIN_JAR" "saturnclient-${TIMESTAMP}.jar" + echo "Created: saturnclient-${TIMESTAMP}.jar" + + - name: Upload timestamped artifact + uses: actions/upload-artifact@v4 + with: + name: saturnclient-${{ github.run_number }} + path: saturnclient-*.jar + if-no-files-found: error diff --git a/gradle.properties b/gradle.properties index 252ae09..013c631 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,7 +11,7 @@ yarn_mappings=1.21.4+build.7 loader_version=0.16.10 fabric_version=0.114.0+1.21.4 -mod_version = 0.0.5-beta2 +mod_version = 0.0.6-beta1 maven_group = org.saturnclient archives_base_name = saturnclient