diff --git a/.github/workflows/gradle-publish.yml b/.github/workflows/gradle-publish.yml index 9e7c955..14c77de 100644 --- a/.github/workflows/gradle-publish.yml +++ b/.github/workflows/gradle-publish.yml @@ -4,7 +4,7 @@ name: Gradle Package on: push: tags: - - 'v*' + - "v*" workflow_dispatch: jobs: @@ -14,44 +14,43 @@ jobs: # If the PR is coming from a fork (pull_request_target), ensure it's opened by "dependabot[bot]". # Otherwise, clone it normally. if: | - (github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]') || - (github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') + (github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]') || + (github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') runs-on: ubuntu-22.04 - permissions: contents: read packages: write steps: - - name: Checkout - if: ${{ github.event_name != 'pull_request_target' }} - uses: actions/checkout@v4.2.0 - with: - fetch-depth: 0 - - - name: Checkout - if: ${{ github.event_name == 'pull_request_target' }} - uses: actions/checkout@v4.2.0 - with: - fetch-depth: 0 - ref: ${{ github.event.pull_request.head.sha }} - - - name: Set up JDK - uses: actions/setup-java@v4.4.0 - with: - java-version-file: .java-version - distribution: 'temurin' - server-id: github - settings-path: ${{ github.workspace }} - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 - - - name: Build with Gradle - run: ./gradlew build - - - name: Publish to GitHub Packages - run: ./gradlew publish - env: - USERNAME: ${{ github.actor }} - TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Checkout + if: ${{ github.event_name != 'pull_request_target' }} + uses: actions/checkout@v4.2.0 + with: + fetch-depth: 0 + + - name: Checkout + if: ${{ github.event_name == 'pull_request_target' }} + uses: actions/checkout@v4.2.0 + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} + + - name: Set up JDK + uses: actions/setup-java@v4.4.0 + with: + java-version-file: .java-version + distribution: "temurin" + server-id: github + settings-path: ${{ github.workspace }} + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + + - name: Build with Gradle + run: ./gradlew build + + - name: Publish to GitHub Packages + run: ./gradlew publish + env: + USERNAME: ${{ github.actor }} + TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index e76ae7f..73e20af 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -22,32 +22,31 @@ jobs: # If the PR is coming from a fork (pull_request_target), ensure it's opened by "dependabot[bot]". # Otherwise, clone it normally. if: | - (github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]') || - (github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') + (github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]') || + (github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') runs-on: ubuntu-22.04 - steps: - - name: Checkout - if: ${{ github.event_name != 'pull_request_target' }} - uses: actions/checkout@v4.2.0 - with: - fetch-depth: 0 - - - name: Checkout - if: ${{ github.event_name == 'pull_request_target' }} - uses: actions/checkout@v4.2.0 - with: - fetch-depth: 0 - ref: ${{ github.event.pull_request.head.sha }} - - - name: Set up JDK - uses: actions/setup-java@v4.4.0 - with: - java-version-file: .java-version - distribution: 'temurin' - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 - - - name: Build with Gradle - run: ./gradlew build + - name: Checkout + if: ${{ github.event_name != 'pull_request_target' }} + uses: actions/checkout@v4.2.0 + with: + fetch-depth: 0 + + - name: Checkout + if: ${{ github.event_name == 'pull_request_target' }} + uses: actions/checkout@v4.2.0 + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} + + - name: Set up JDK + uses: actions/setup-java@v4.4.0 + with: + java-version-file: .java-version + distribution: "temurin" + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + + - name: Build with Gradle + run: ./gradlew build diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 18acf70..87510cb 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -12,10 +12,9 @@ jobs: # If the PR is coming from a fork (pull_request_target), ensure it's opened by "dependabot[bot]". # Otherwise, clone it normally. if: | - (github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]') || - (github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') + (github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]') || + (github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') runs-on: ubuntu-22.04 - steps: - name: Checkout if: ${{ github.event_name != 'pull_request_target' }}