Skip to content

Commit d24d4c1

Browse files
committed
added new gha config. run test, build and push gem to gpr in one action.
1 parent e343146 commit d24d4c1

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/main.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: main
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
tags:
8+
- '*'
9+
pull_request:
10+
branches:
11+
- 'main'
12+
types: [opened, synchronize]
13+
pull_request_target:
14+
branches:
15+
- 'main'
16+
types: [labeled]
17+
18+
jobs:
19+
test:
20+
name: test
21+
runs-on: ubuntu-latest
22+
if: >
23+
${{
24+
github.event_name == 'pull_request' ||
25+
github.event_name == 'workflow_dispatch' ||
26+
(github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'safe to test')) ||
27+
startsWith(github.ref, 'refs/tags/')
28+
}}
29+
steps:
30+
- uses: actions/checkout@v2
31+
- name: Set up JDK 1.8
32+
uses: actions/setup-java@v1
33+
with:
34+
java-version: 1.8
35+
- name: Test
36+
run: ./gradlew test
37+
build:
38+
name: Build + Publish
39+
runs-on: ubuntu-latest
40+
permissions:
41+
packages: write
42+
contents: read
43+
needs: [ test ]
44+
if: ${{ github.event_name == 'workflow_dispatch' || contains(github.ref, 'refs/tags/') }}
45+
steps:
46+
- name: push gem
47+
uses: trocco-io/push-gem-to-gpr-action@v1
48+
with:
49+
language: java
50+
gem-path: "./build/gems/*.gem"
51+
github-token: "${{ secrets.GITHUB_TOKEN }}"

0 commit comments

Comments
 (0)