-
Notifications
You must be signed in to change notification settings - Fork 6
57 lines (55 loc) · 1.35 KB
/
main.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
name: main
on:
push:
branches:
- 'master'
tags:
- '*'
pull_request:
branches:
- 'master'
types: [opened, synchronize]
pull_request_target:
branches:
- 'master'
types: [labeled]
jobs:
test:
name: test
runs-on: ubuntu-latest
if: >
${{
github.event_name == 'pull_request' ||
(github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'safe to test')) ||
startsWith(github.ref, 'refs/tags/')
}}
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: lint
run: ./gradlew spotlessCheck
- name: Test
run: ./gradlew test
build:
name: Build + Publish
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
needs: [ test ]
if: ${{ github.event_name == 'workflow_dispatch' || contains(github.ref, 'refs/tags/') }}
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: push gem
uses: trocco-io/push-gem-to-gpr-action@v1
with:
language: java
gem-path: "./build/gems/*.gem"
github-token: "${{ secrets.GITHUB_TOKEN }}"