-
Notifications
You must be signed in to change notification settings - Fork 138
47 lines (44 loc) · 1.3 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
45
46
47
name: "CI"
on:
push:
branches:
- "master"
- "5.x"
- "6.x"
pull_request:
branches:
- "master"
- "5.x"
- "6.x"
env:
gradle-version: "7.4.1"
java-version: "17"
jobs:
build:
runs-on: "ubuntu-latest"
steps:
- name: "Checkout repository"
uses: "actions/checkout@v2"
- name: "Set up JDK"
uses: "actions/setup-java@v1"
with:
java-version: "${{ env.java-version }}"
- name: "Gradle build"
uses: "eskatos/gradle-command-action@v1"
with:
gradle-version: "${{ env.gradle-version }}"
arguments: "--build-cache assemble"
- name: "Gradle check"
uses: "eskatos/gradle-command-action@v1"
with:
gradle-version: "${{ env.gradle-version }}"
arguments: "check"
- name: "GitHub release"
if: "contains('refs/heads/master refs/heads/5.x refs/heads/6.x', github.ref)"
run: |
version=$(cat gradle.properties | grep -e "^version *=" | awk -F" *= *" '{print $NF}')
is_snapshot=$(echo ${version} | grep -e "-SNAPSHOT$" | wc -l)
if [ "$is_snapshot" == "0" ]; then
echo ${{ github.token }} | gh auth login --with-token
gh release create ${version} ./build/distributions/*.zip
fi