forked from square/javapoet
-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (30 loc) · 938 Bytes
/
build.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
name: build
on:
push:
pull_request:
jobs:
build:
name: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java-version:
- 11
- 17
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: zulu
java-version: ${{ matrix.java-version }}
- name: Build with Gradle
run: ./gradlew build
- name: Publish
if: ${{ (github.ref == 'refs/heads/main' || startswith(github.ref, 'refs/tags/')) && matrix.java-version == '11' }}
run: ./gradlew publish
env:
SIGNING_PRIVATE_KEY: ${{ secrets.MAVEN_CENTRAL_GPG_KEY }}
SIGNING_PASSWORD: ${{ secrets.MAVEN_CENTRAL_GPG_PASSWORD }}
ORG_GRADLE_PROJECT_sonatype_username: ${{ secrets.SONATYPE_S01_USERNAME }}
ORG_GRADLE_PROJECT_sonatype_password: ${{ secrets.SONATYPE_S01_PASSWORD }}