Skip to content

Commit 24964fd

Browse files
authored
Polish GitHub Actions workflows (#757)
* Fix a wrong property * Rename to avoid unnecessary schema validation * Use JDK 17 * Introduce gradle-build-action
1 parent c7c7e5c commit 24964fd

File tree

5 files changed

+19
-41
lines changed

5 files changed

+19
-41
lines changed

.github/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ categories:
1313
- 'bug'
1414
- 'fix'
1515
- title: 'Maintenance'
16-
label:
16+
labels:
1717
- 'ci'
1818
- 'chore'
1919
- 'perf'

.github/workflows/changelog.yml

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,14 @@ jobs:
1515
with:
1616
ref: master
1717

18-
- name: Grant execute permission for gradlew
19-
run: chmod +x gradlew
20-
21-
- name: Cache Gradle
22-
uses: actions/cache@v2
23-
with:
24-
path: |
25-
~/.gradle/caches
26-
~/.gradle/wrapper
27-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
28-
restore-keys: |
29-
${{ runner.os }}-gradle-
30-
3118
- name: Update CHANGELOG.md
32-
run: |
33-
export ORG_GRADLE_PROJECT_releaseBody=$(jq '.release.body' $GITHUB_EVENT_PATH)
34-
export ORG_GRADLE_PROJECT_releaseHtmlUrl=$(jq '.release.html_url' $GITHUB_EVENT_PATH)
35-
export ORG_GRADLE_PROJECT_releaseName=$(jq '.release.name' $GITHUB_EVENT_PATH)
36-
./gradlew updateChangelog
19+
uses: gradle/gradle-build-action@v2
20+
env:
21+
ORG_GRADLE_PROJECT_releaseBody: $(jq '.release.body' $GITHUB_EVENT_PATH)
22+
ORG_GRADLE_PROJECT_releaseHtmlUrl: $(jq '.release.html_url' $GITHUB_EVENT_PATH)
23+
ORG_GRADLE_PROJECT_releaseName: $(jq '.release.name' $GITHUB_EVENT_PATH)
24+
with:
25+
arguments: updateChangelog
3726

3827
- name: Commit changes
3928
uses: EndBug/add-and-commit@v7

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@ jobs:
2525
distribution: 'zulu'
2626
java-version: 11
2727

28-
- name: Grant execute permission for gradlew
29-
run: chmod +x gradlew
30-
3128
- name: Build
32-
run: ./gradlew assemble check
29+
uses: gradle/gradle-build-action@v2
30+
with:
31+
arguments: assemble check
3332

3433
- name: Perform CodeQL Analysis
3534
uses: github/codeql-action/analyze@v1
File renamed without changes.

.github/workflows/release.yml

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,36 +36,26 @@ jobs:
3636
if: github.event.inputs.version == null
3737
run: echo "RELEASE_VERSION=${{ steps.candidate-version.outputs.result }}" >> $GITHUB_ENV
3838

39-
- name: Set up JDK 11
39+
- name: Set up JDK 17
4040
uses: actions/setup-java@v2
4141
with:
4242
distribution: 'zulu'
43-
java-version: 11
43+
java-version: 17
4444

4545
- name: Checkout
4646
uses: actions/checkout@v2
4747
with:
4848
token: ${{ secrets.REPO_ACCESS_TOKEN }}
4949

50-
- name: Grant execute permission for gradlew
51-
run: chmod +x gradlew
52-
53-
- name: Cache Gradle
54-
uses: actions/cache@v2
55-
with:
56-
path: |
57-
~/.gradle/caches
58-
~/.gradle/wrapper
59-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
60-
restore-keys: |
61-
${{ runner.os }}-gradle-
62-
63-
- name: Release ${{ env.RELEASE_VERSION }}
50+
- name: Prepare git config
6451
run: |
65-
java -version
6652
git config --global user.name "github-actions[bot]"
6753
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
68-
./gradlew release -Prelease.releaseVersion=${{ env.RELEASE_VERSION }}
54+
55+
- name: Release ${{ env.RELEASE_VERSION }}
56+
uses: gradle/gradle-build-action@v2
57+
with:
58+
arguments: release -Prelease.releaseVersion=${{ env.RELEASE_VERSION }}
6959

7060
- name: Upload reports
7161
if: failure()

0 commit comments

Comments
 (0)