fix update-gradle-wrapper pipeline
[yosql.git] / .github / workflows / update-gradle-wrapper.yml
blobf6db93aa69e8c9d3b156a8229c3609fddfe2248d
1 name: Update Gradle Wrapper
2 on:
3   schedule:
4     - cron: 0 3 3 * *
5 env:
6   JAVA_VERSION: 17
7   JAVA_PACKAGE: jdk
8   JAVA_ARCH: x64
9   JAVA_DISTRO: temurin
10 jobs:
11   update-gradle-wrapper:
12     runs-on: ubuntu-latest
13     steps:
14       - id: checkout
15         name: Clone Git Repository
16         uses: actions/checkout@v3
17       - id: java
18         name: Setup Java
19         uses: actions/setup-java@v3
20         with:
21           java-version: ${{ env.JAVA_VERSION }}
22           java-package: ${{ env.JAVA_PACKAGE }}
23           architecture: ${{ env.JAVA_ARCH }}
24           distribution: ${{ env.JAVA_DISTRO }}
25       - id: cache
26         name: Cache Maven Repository
27         uses: actions/cache@v3
28         with:
29           path: ~/.m2/repository
30           key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
31           restore-keys: |
32             ${{ runner.os }}-maven-
33       - id: maven
34         name: Maven Tooling
35         run: mvn --batch-mode install --define skipTests
36       - id: gwu
37         name: yosql-tooling-gradle
38         uses: EdwarDDay/upgrade-gradle-action@v1
39         with:
40           working-directory: yosql-tooling/yosql-tooling-gradle
41           distribution-type: all
42       - name: yosql-examples-gradle
43         uses: EdwarDDay/upgrade-gradle-action@v1
44         with:
45           working-directory: yosql-examples/yosql-examples-gradle
46           distribution-type: all
47       - name: Validate Gradle Wrapper
48         uses: gradle/wrapper-validation-action@v1
49       - id: cpr
50         name: Create Pull Request
51         uses: peter-evans/create-pull-request@v4
52         with:
53           token: ${{ secrets.PAT }}
54           commit-message: Update gradle-wrapper to latest version
55           committer: GitHub <noreply@github.com>
56           author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
57           title: Update gradle-wrapper to latest version
58           body: ${{ steps.gwu.outputs.version-information }}
59           labels: |
60             Build :: Gradle
61             Priority :: Low
62             Type :: Task
63           assignees: sebhoss
64           draft: false
65           base: main
66           branch: update-gradle-wrapper
67           delete-branch: true
68       - name: Enable Pull Request Automerge
69         if: steps.cpr.outputs.pull-request-operation == 'created'
70         uses: peter-evans/enable-pull-request-automerge@v2
71         with:
72           token: ${{ secrets.PAT }}
73           pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
74           merge-method: rebase