-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (42 loc) · 1.39 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
on:
push:
branches:
- main
- master
- 'release/**'
pull_request:
branches:
- main
- master
- 'release/**'
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Set environment
run: echo "VERSION=${GITHUB_REF/refs\/heads\/release\//}.$GITHUB_RUN_NUMBER" >> $GITHUB_ENV
- name: Display environment information
run: |
echo Building version: ${{ env.VERSION }}
- uses: actions/checkout@v2
- name: Set up development environment
uses: actions/setup-java@v1
with:
java-version: 17
- name: Install packages
run: gradle wrapper
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
- name: Run build and test
run: ./gradlew build --info
- name: Create Github Release and Tag
if: github.ref != 'refs/heads/main' && github.ref != 'refs/heads/master' && github.event_name == 'push'
run: |
git tag ${GITHUB_REF/refs\/heads\/release\//}.$GITHUB_RUN_NUMBER
git push origin ${GITHUB_REF/refs\/heads\/release\//}.$GITHUB_RUN_NUMBER
- name: Publish SDK
if: github.ref != 'refs/heads/main' && github.ref != 'refs/heads/master' && github.event_name == 'push'
run: gradle publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_OSSRH_TOKEN: ${{ secrets.MAVEN_OSSRH_TOKEN }}