-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (92 loc) · 3 KB
/
continuous-integration.yaml
File metadata and controls
103 lines (92 loc) · 3 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: CI
on:
push:
pull_request:
release:
types: [ published ]
env:
JDK_DISTRIBUTION: zulu
JDK_VERSION: 11
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch history and tags; necessary for computing project version.
- name: Set up JDK ${{ env.JDK_VERSION }}
uses: actions/setup-java@v3
with:
distribution: ${{ env.JDK_DISTRIBUTION }}
java-version: ${{ env.JDK_VERSION }}
- name: Generate classes and native binaries
uses: gradle/gradle-build-action@v2
with:
arguments: classes check javadocJar sourcesJar -x test
- name: Upload generated files for other jobs
uses: actions/upload-artifact@v3
with:
name: ClassesAndResources
path: |
build/classes
build/libs
build/resources
test:
name: test (${{ matrix.os }}, JDK ${{ matrix.java }})
needs: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- macos-10.15
- ubuntu-18.04
- ubuntu-20.04
java:
- 11
# - 14
steps:
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
distribution: ${{ env.JDK_DISTRIBUTION }}
java-version: ${{ matrix.java }}
- name: Download generated files
uses: actions/download-artifact@v3
with:
name: ClassesAndResources
path: build
- name: Test with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: -x classes test --tests=*AbyTest.constantGate
publish:
needs: test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch history and tags; necessary for computing project version.
- name: Set up JDK ${{ env.JDK_VERSION }}
uses: actions/setup-java@v3
with:
distribution: ${{ env.JDK_DISTRIBUTION }}
java-version: ${{ env.JDK_VERSION }}
- name: Download generated files
uses: actions/download-artifact@v3
with:
name: ClassesAndResources
path: build
- name: Publish to GitHub Packages and Maven Central
uses: gradle/gradle-build-action@v2
with:
arguments: >
${{ github.event_name != 'release' && '--dry-run' || '' }}
-x classes -x javadocJar -x sourcesJar
publish closeAndReleaseSonatypeStagingRepository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEUSERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEPASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }}