-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (51 loc) · 1.39 KB
/
main.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: CI
on:
push:
branches: [main]
# Release tag format is v[version]
# For example: v1.3.5-0
tags: ['v*']
pull_request:
branches: [main]
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: 11
- name: Run Check
uses: eskatos/gradle-command-action@v1
with:
arguments: check -xlint
distributions-cache-enabled: true
dependencies-cache-enabled: true
- name: Run Detekt
uses: eskatos/gradle-command-action@v1
with:
arguments: detektAll detektReleaseAll
publish:
name: Publish
needs: check
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/') }}
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: 11
- name: Run Publish
uses: eskatos/gradle-command-action@v1
with:
arguments: publish
distributions-cache-enabled: true
dependencies-cache-enabled: true
env:
ORG_GRADLE_PROJECT_githubPackagesUsername: ${{ github.actor }}
ORG_GRADLE_PROJECT_githubPackagesPassword: ${{ secrets.GITHUB_TOKEN }}