diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml deleted file mode 100644 index f36d0d0c..00000000 --- a/.github/workflows/build-pr.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Build PR -on: [ pull_request ] -jobs: - build_pr: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ ubuntu-latest, windows-latest, macos-latest ] - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - name: Validate Gradle Wrapper - uses: gradle/wrapper-validation-action@v1 - - name: Setup Java - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: 21 - - name: Build on ${{ matrix.os }} - run: ./gradlew clean build diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..93677fe1 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,28 @@ +# 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://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle + +name: Java CI with Gradle +on: [ pull_request, push ] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'temurin' + - name: Build with Gradle + uses: gradle/actions/setup-gradle@v3 + with: + arguments: shadowJar + - name: Upload a Build Artifact + uses: actions/upload-artifact@v4 + with: + path: build/libs/* + if-no-files-found: error \ No newline at end of file diff --git a/.github/workflows/hangar-publish.yml b/.github/workflows/hangar-publish.yml new file mode 100644 index 00000000..0bbd0eac --- /dev/null +++ b/.github/workflows/hangar-publish.yml @@ -0,0 +1,24 @@ +name: Hangar Publish + +on: + release: + types: + - prereleased + - released + +jobs: + build: + env: + HANGAR_API_TOKEN: ${{ secrets.HANGAR_API_TOKEN }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'temurin' + - name: Publish with Gradle to Hangar + uses: gradle/actions/setup-gradle@v3 + with: + arguments: publishAllPublicationsToHangar \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 362a9502..00000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Publish -on: - push: - branches: - - master - - dev -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - name: Validate Gradle Wrapper - uses: gradle/wrapper-validation-action@v1 - - name: Setup Java - uses: actions/setup-java@v4 - with: - distribution: temurin - cache: gradle - java-version: 21 - - name: Publish - env: - HANGAR_SECRET: ${{secrets.HANGAR_KEY}} - run: ./gradlew build publishAllPublicationsToHangar --stacktrace