-
Notifications
You must be signed in to change notification settings - Fork 3
91 lines (73 loc) · 2.59 KB
/
publish.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Publish Artifacts
on:
push:
tags:
- '**'
env:
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_PWD: ${{ secrets.SONATYPE_PWD }}
OSS_USER: '${{ secrets.OSS_USER }}'
OSS_TOKEN: '${{ secrets.OSS_TOKEN }}'
OSS_STAGING_PROFILE_ID: '${{ secrets.OSS_STAGING_PROFILE_ID }}'
SIGNING_KEY_NAME: '${{ secrets.SIGNING_KEY_NAME }}'
SIGNING_KEY_ID: '${{ secrets.SIGNING_KEY_ID }}'
SIGNING_KEY_PASSPHRASE: '${{ secrets.SIGNING_KEY_PASSPHRASE }}'
SIGNING_KEY: '${{ secrets.SIGNING_KEY }}'
GRADLE_PUBLISH_KEY: '${{ secrets.GRADLE_PUBLISH_KEY }}'
GRADLE_PUBLISH_SECRET: '${{ secrets.GRADLE_PUBLISH_SECRET }}'
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
outputs:
endpoints-version: ${{ steps.get-endpoints-version.outputs.endpoints-version }}
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
- uses: actions/[email protected]
with:
distribution: 'adopt'
java-version: '15'
- name: Build and test with Gradle
uses: gradle/[email protected]
with:
arguments: build --scan --stacktrace
- id: get-endpoints-version
name: Get Endpoints version
run: |
./gradlew
echo "::set-output name=endpoints-version::$(head -n 1 build/semver/version.txt)"
- name: Upload reports
uses: actions/[email protected]
with:
name: 'reports-${{ matrix.os }}'
path: '**/build/reports/**'
- name: Stop Gradle daemons
run: ./gradlew --stop
publish:
needs: build
env:
JAVA_OPTS: -Xms512m -Xmx1024m
runs-on: macos-11
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
distribution: 'adopt'
java-version: '15'
cache: 'gradle'
- name: Publish alpha/beta/rc artifacts
if: |
contains(needs.build.outputs.endpoints-version, 'alpha') ||
contains(needs.build.outputs.endpoints-version, 'beta') ||
contains(needs.build.outputs.endpoints-version, 'rc')
run: ./gradlew --full-stacktrace publishToSonatype closeAndReleaseSonatypeStagingRepository -x dokkaHtml
- name: Publish final artifacts
if: |
!contains(needs.build.outputs.endpoints-version, 'alpha') &&
!contains(needs.build.outputs.endpoints-version, 'beta') &&
!contains(needs.build.outputs.endpoints-version, 'rc')
run: ./gradlew --full-stacktrace publishToSonatype closeAndReleaseSonatypeStagingRepository -x dokkaHtml
- name: Stop Gradle daemons
run: ./gradlew --stop