File tree Expand file tree Collapse file tree 3 files changed +95
-0
lines changed
Expand file tree Collapse file tree 3 files changed +95
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build master branch
2+
3+ on :
4+ push :
5+ branches :
6+ - master
7+
8+ jobs :
9+ build :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : Checkout latest code
13+ uses : actions/checkout@v2
14+
15+ - name : Setup JDK 8
16+ uses : actions/setup-java@v1
17+ with :
18+ java-version : 8
19+
20+ - name : Setup build cache
21+ uses : actions/cache@v2
22+ with :
23+ path : ~/.gradle/caches
24+ key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
25+ restore-keys : ${{ runner.os }}-gradle-
26+
27+ - name : Build with Gradle
28+ run : ./gradlew build
29+
30+ - name : Upload artifact
31+ uses : actions/upload-artifact@v1
32+ with :
33+ name : Package
34+ path : build/libs
Original file line number Diff line number Diff line change 1+ name : Publish release
2+
3+ on :
4+ release :
5+ types : [published]
6+
7+ jobs :
8+ publish-release :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : Checkout latest code
12+ uses : actions/checkout@v2
13+
14+ - name : Setup JDK 8
15+ uses : actions/setup-java@v1
16+ with :
17+ java-version : 8
18+
19+ - name : Setup build cache
20+ uses : actions/cache@v2
21+ with :
22+ path : ~/.gradle/caches
23+ key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
24+ restore-keys : ${{ runner.os }}-gradle-
25+
26+ - name : Publish artifact
27+ env :
28+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
29+ # The GITHUB_REF tag comes in the format 'refs/tags/xxx'.
30+ # So if we split on '/' and take the 3rd value, we can get the release name.
31+ run : |
32+ NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3)
33+ echo "New version: ${NEW_VERSION}"
34+ echo "Github username: ${GITHUB_ACTOR}"
35+ ./gradlew -Pversion=${NEW_VERSION} publish
Original file line number Diff line number Diff line change 1+ name : Build pull request
2+
3+ on : [pull_request]
4+
5+ jobs :
6+ build :
7+ runs-on : ubuntu-latest
8+
9+ steps :
10+ - name : Checkout latest code
11+ uses : actions/checkout@v2
12+
13+ - name : Setup JDK 8
14+ uses : actions/setup-java@v1
15+ with :
16+ java-version : 8
17+
18+ - name : Setup build cache
19+ uses : actions/cache@v2
20+ with :
21+ path : ~/.gradle/caches
22+ key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
23+ restore-keys : ${{ runner.os }}-gradle-
24+
25+ - name : Build with Gradle
26+ run : ./gradlew build
You can’t perform that action at this time.
0 commit comments