-
Notifications
You must be signed in to change notification settings - Fork 49
70 lines (66 loc) · 2.05 KB
/
primary.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
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Checks
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
name: ${{ matrix.os }} ${{ matrix.arch }} check
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
arch: [x64]
steps:
- uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
architecture: ${{ matrix.arch }}
- name: Test with Gradle
run: ./gradlew test
test-on-mac-arm:
name: ${{ matrix.os }} ${{ matrix.arch }} check
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
arch: [arm64]
steps:
- uses: actions/checkout@v3
- name: Set up Java on ARM64
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '13'
- name: Test with Gradle
run: ./gradlew test
publish:
name: Publish to snapshot repo if master branch
runs-on: ubuntu-latest
needs: [test, test-on-mac-arm]
if: github.ref == 'refs/heads/master' && always()
steps:
- uses: technote-space/workflow-conclusion-action@v3
- uses: actions/checkout@v3
if: env.WORKFLOW_CONCLUSION == 'success'
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
if: env.WORKFLOW_CONCLUSION == 'success'
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v3
with:
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
if: env.WORKFLOW_CONCLUSION == 'success'
- name: Publish
run: ./gradlew publishSnapshotPublicationToSnapshotRepository -Psigning.gnupg.keyName="${{ secrets.GPG_SIGNING_SUBKEY_ID }}" -Psigning.password="${{ secrets.GPG_PASSPHRASE }}" -PossrhUsername="terl" -PossrhPassword="${{ secrets.SONATYPE_PASSWORD }}"
if: env.WORKFLOW_CONCLUSION == 'success'