-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (50 loc) · 1.74 KB
/
ci.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
name: ci
on:
push:
jobs:
build:
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
java: [ '8', '17', '21' ]
platform: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ]
exclude:
- platform: ${{ github.repository == 'open-coap/kotlin-mbedtls' || 'macos-latest' }}
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'corretto'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
- name: Enable using libraries from temporary location in mac
if: ${{ matrix.platform == 'macos-latest' }}
run: sudo spctl --master-disable
- name: Build with Gradle
run: ./gradlew build -i
publish:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'adopt'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
- name: Publish with Gradle
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -i
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_ossrhUserName: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRH_PASSWORD }}