-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (36 loc) · 1.07 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
38
39
40
41
42
43
44
name: CI
on:
push:
branches:
- master
tags:
- 'v*.*.*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '8'
- name: Install GPG2
run: sudo apt install gnupg2
- name: Write private key
run: echo -n ${{ secrets.GPG_PRIVATE }} | base64 -d >> private.gpg
- name: Import private key
run: gpg2 --allow-secret-key-import --import private.gpg
- name: Test with Gradle
run: ./gradlew test
- name: Build with Gradle
run: ./gradlew build
env:
GPG_KEYNAME: ${{ secrets.GPG_KEYNAME }}
- name: Release Build
if: startsWith(github.ref, 'refs/tags/v')
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
GPG_KEYNAME: ${{ secrets.GPG_KEYNAME }}