diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 9da97294..467fe6c0 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -5,7 +5,7 @@ # 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 +name: Forge Action on: push: @@ -22,27 +22,36 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up JDK 17 - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'temurin' - - name: Validate Gradle Wrapper - uses: gradle/wrapper-validation-action@v1 - - name: Make Gradle Wrapper Executable - run: chmod +x ./gradlew - - name: Build - uses: gradle/gradle-build-action@v2 - with: - arguments: build - - name: Find Correct JAR - id: findjar - run: | - output="$(find build/libs/ ! -name "*-sources.jar" -type f -printf "%f\n")" - echo "::set-output name=jarname::$output" - - name: Upload Build Artifacts - uses: actions/upload-artifact@v3 - with: - name: ${{ steps.findjar.outputs.jarname }} - path: build/libs/${{ steps.findjar.outputs.jarname }} + - name: Checkout code + uses: actions/checkout@v4 + with: + show-progress: false + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'dragonwell' + + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v1 + + - name: Make Gradle Wrapper Executable + run: chmod +x ./gradlew + + - name: Build + uses: gradle/gradle-build-action@v2 + with: + arguments: build + + - name: Find Correct JAR + id: findjar + run: | + output="$(find build/libs/ ! -name "*-sources.jar" -type f -printf "%f\n")" + echo "::set-output name=jarname::$output" + + - name: Upload Build Artifacts + uses: actions/upload-artifact@v3 + with: + name: ${{ steps.findjar.outputs.jarname }} + path: build/libs/${{ steps.findjar.outputs.jarname }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..0ed37fcc --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ +name: Forge Release + +on: + push: + tags: + - 'v*' + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + show-progress: false + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'dragonwell' + + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v1 + + - name: Make Gradle Wrapper Executable + run: chmod +x ./gradlew + + - name: Build project + run: | + gradle wrapper + bash gradlew buildNeeded + + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + name: Re-Avaritia-Lex-${{ github.ref }} + files: build/libs/* + body: Please refer to [CHANGELOG.md](https://github.com/Nova-Committee/re-avaritia/blob/master/CHANGELOG.md) for details. \ No newline at end of file