This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (62 loc) · 1.9 KB
/
gradle_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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: CI
on: [ push ]
env:
APP_JAVA_VERSION: 15
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: ${{ env.APP_JAVA_VERSION }}
- uses: actions/cache@v2.1.4
name: Restore gradle cache
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: |
${{ runner.OS }}-gradle-${{ env.cache-name }}-
${{ runner.OS }}-gradle-
${{ runner.OS }}-
- uses: actions/cache@v2.1.4
name: Cache gradle wrapper
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- name: Set gradle permissions
run: chmod +x gradlew
- name: Check project
run: ./gradlew check
env:
GITHUB_USER: RakSrinaNa
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish:
runs-on: ubuntu-latest
needs: build
if: "startsWith(github.ref, 'refs/tags/')"
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: ${{ env.APP_JAVA_VERSION }}
- uses: actions/cache@v2.1.4
name: Restore gradle cache
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: |
${{ runner.OS }}-gradle-${{ env.cache-name }}-
${{ runner.OS }}-gradle-
${{ runner.OS }}-
- name: Set gradle permissions
run: chmod +x gradlew
- name: Publish project
run: ./gradlew publish
env:
GITHUB_USER: RakSrinaNa
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}