Skip to content

Commit a7e8ef4

Browse files
committed
Use Github Actions Replace Travis-Ci
1 parent b28a6f3 commit a7e8ef4

File tree

3 files changed

+113
-36
lines changed

3 files changed

+113
-36
lines changed

.github/workflows/build-master.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Build master branch
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
name: Build on java ${{ matrix.java }}
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
java: ['8', '11']
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
# https://github.com/actions/virtual-environments/issues/929
19+
- name: "Setup /etc/hosts for Linux"
20+
shell: bash
21+
run: |
22+
if [ `uname` = "Linux" ]; then
23+
echo "\$ cat /etc/hosts"
24+
cat /etc/hosts
25+
echo
26+
(
27+
echo "127.0.0.1 localhost";
28+
echo "::1 localhost ip6-localhost ip6-loopback";
29+
) | sudo tee /etc/hosts
30+
echo
31+
echo "\$ cat /etc/hosts"
32+
cat /etc/hosts
33+
fi
34+
35+
- name: Set up java ${{ matrix.java }}
36+
uses: actions/setup-java@v1
37+
with:
38+
java-version: ${{ matrix.java }}
39+
40+
- name: Cache Gradle packages
41+
uses: actions/cache@v2
42+
with:
43+
path: ~/.gradle/caches
44+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
45+
restore-keys: ${{ runner.os }}-gradle
46+
47+
- name: Grant execute permission for gradlew
48+
run: chmod +x gradlew
49+
50+
- name: Decrypt file
51+
run: openssl aes-256-cbc -K ${{ secrets.ENCRYPTED_KEY }} -iv ${{ secrets.ENCRYPTED_IV }} -in private.key.enc -out ./private.key -d && gpg --batch --import ./private.key || echo
52+
53+
- name: Build with Gradle
54+
run: ./gradlew --scan --stacktrace --warning-mode=all build
55+
56+
- name: Deploy with Gradle
57+
run: ./gradlew --scan publish -x check -Psigning.gnupg.executable=gpg -Psigning.gnupg.keyName=${{ secrets.GPG_NAME }} -Psigning.gnupg.passphrase=${{ secrets.GPG_PASSWORD }}
58+
if: ${{ matrix.java == '8' }}
59+
env:
60+
OSSRH_USER: ${{ secrets.OSSRH_USER }}
61+
OSSRH_PASS: ${{ secrets.OSSRH_PASS }}

.github/workflows/pull-request.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Pull Request CI
2+
3+
on: ['pull_request']
4+
5+
jobs:
6+
build:
7+
name: Build on java ${{ matrix.java }}
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
java: ['8', '11']
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
# https://github.com/actions/virtual-environments/issues/929
16+
- name: "Setup /etc/hosts for Linux"
17+
shell: bash
18+
run: |
19+
if [ `uname` = "Linux" ]; then
20+
echo "\$ cat /etc/hosts"
21+
cat /etc/hosts
22+
echo
23+
(
24+
echo "127.0.0.1 localhost";
25+
echo "::1 localhost ip6-localhost ip6-loopback";
26+
) | sudo tee /etc/hosts
27+
echo
28+
echo "\$ cat /etc/hosts"
29+
cat /etc/hosts
30+
fi
31+
32+
- name: Set up java ${{ matrix.java }}
33+
uses: actions/setup-java@v1
34+
with:
35+
java-version: ${{ matrix.java }}
36+
37+
- name: Cache Gradle packages
38+
uses: actions/cache@v2
39+
with:
40+
path: ~/.gradle/caches
41+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
42+
restore-keys: ${{ runner.os }}-gradle
43+
44+
- name: Grant execute permission for gradlew
45+
run: chmod +x gradlew
46+
47+
- name: Build with Gradle
48+
run: ./gradlew --scan --stacktrace --warning-mode=all build
49+
50+
# Avoid publish errors when upgrading gradle version and dependencyManager plugin
51+
- name: Try publishToMavenLocal
52+
run: ./gradlew publishToMavenLocal

.travis.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)