-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (55 loc) · 1.94 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
name: Publish
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to publish'
required: true
default: ''
maven:
type: boolean
description: 'Publishing jar artifacts'
required: true
default: true
docker:
type: boolean
description: 'Publishing Docker images'
required: true
default: true
gradle:
type: boolean
description: 'Publishing Gradle plugin'
required: true
default: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the selected tag
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.tag }}
fetch-depth: 0
- name: Set up JDK 1.8
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '8'
- name: Verify build
run: ./gradlew build test javadoc publishToLocalDocker
- name: Login to GitHub Container Registry
if: ${{ github.event.inputs.docker == 'true' }}
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push docker images
if: ${{ github.event.inputs.docker == 'true' }}
run: ./gradlew publishToDocker
- name: Upload artifacts to Maven Central staging
if: ${{ github.event.inputs.maven == 'true' }}
run: ./gradlew :publishToMavenCentral :closeAndReleaseStagingRepository -PsigningPassword="${{ secrets.MAVEN_KEY_PASS }}" -PsigningKey="${{ secrets.MAVEN_KEY }}" -PsonatypeUsername="${{ secrets.OSSRH_USER }}" -PsonatypePassword="${{ secrets.OSSRH_PASS }}"
- name: Publish Gradle plugin
if: ${{ github.event.inputs.gradle == 'true' }}
run: ./gradlew publishPlugins -Pgradle.publish.key="${{ secrets.GRADLE_KEY }}" -Pgradle.publish.secret="${{ secrets.GRADLE_SECRET }}"