diff --git a/.github/workflows/gradle-build.yml b/.github/workflows/gradle-build.yml index 2b467ab..5328c79 100644 --- a/.github/workflows/gradle-build.yml +++ b/.github/workflows/gradle-build.yml @@ -17,16 +17,11 @@ jobs: gradle-build: name: Gradle Build runs-on: ubuntu-latest - permissions: - contents: write - needs: - - gradle-wrapper-validation - env: - DEPENDENCY_GRAPH_EXCLUDE_PROJECTS: ':(gradm|initialization|project)' + needs: gradle-wrapper-validation steps: - uses: actions/checkout@v4 with: - fetch-depth: 2 + fetch-depth: 0 - uses: actions/setup-java@v4 with: @@ -37,6 +32,13 @@ jobs: uses: gradle/actions/setup-gradle@v3 with: gradle-home-cache-cleanup: true - dependency-graph: generate-and-submit - run: ./gradlew build --no-daemon --stacktrace + + gradle-submit-dependency-graph: + name: Gradle Submit Dependency Graph + uses: OmicoDev/gradle-project-initializer-template/.github/workflows/gradle-submit-dependency-graph.yml@main + if: ${{ github.ref == 'refs/heads/main' }} + needs: gradle-build + permissions: + contents: write diff --git a/.github/workflows/gradle-submit-dependency-graph.yml b/.github/workflows/gradle-submit-dependency-graph.yml new file mode 100644 index 0000000..b69d35d --- /dev/null +++ b/.github/workflows/gradle-submit-dependency-graph.yml @@ -0,0 +1,28 @@ +name: Gradle Submit Dependency Graph + +on: + workflow_call: + +permissions: + contents: write + +jobs: + gradle-submit-dependency-graph: + runs-on: ubuntu-latest + env: + DEPENDENCY_GRAPH_EXCLUDE_PROJECTS: ':(gradm|initialization|project)' + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + with: + gradle-home-cache-cleanup: true + dependency-graph: generate-and-submit + + - run: ./gradlew build --no-daemon --stacktrace