-
Notifications
You must be signed in to change notification settings - Fork 26
37 lines (28 loc) · 1.08 KB
/
ci.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
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Generate cache key
run: ./.github/workflows/checksum.sh checksum.txt
- uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ matrix.java-version }}-${{ hashFiles('checksum.txt') }}
restore-keys: |
${{ runner.os }}-gradle-${{ matrix.java-version }}-
- name: Configure JDK
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '20'
- name: Test
run: ./gradlew build check
- name: Publish (default branch only)
if: github.repository == 'slackhq/EitherNet' && github.ref == 'refs/heads/main'
run: ./gradlew publishAllPublicationsToMavenCentralRepository -PmavenCentralUsername=${{ secrets.SONATYPEUSERNAME }} -PmavenCentralPassword=${{ secrets.SONATYPEPASSWORD }}