-
Notifications
You must be signed in to change notification settings - Fork 3
41 lines (34 loc) · 1.2 KB
/
build-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Build and Test with Gradle
on: push
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
gradle: ["6.9.4", "7.6.4", "8.8"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: ${{ matrix.gradle }}
- name: Build with Gradle
run: gradle --stacktrace check
- name: Release next version
if: github.ref == 'refs/heads/main' && matrix.gradle == '6.9.4'
run: gradle :libyear-gradle-plugin:release -Prelease.customUsername="${USER}" -Prelease.customPassword="${PW}"
env:
USER: ${{ github.actor }}
PW: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to Gradle Plugin Portal
if: github.ref == 'refs/heads/main' && matrix.gradle == '6.9.4'
run: gradle :libyear-gradle-plugin:publishPlugins -Pgradle.publish.key="${KEY}" -Pgradle.publish.secret="${SECRET}"
env:
KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}