-
Notifications
You must be signed in to change notification settings - Fork 33
42 lines (38 loc) · 1.29 KB
/
publish.yaml
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
name: Publish
on:
workflow_dispatch:
inputs:
forceVersion:
description: 'Force version'
required: false
default: ''
release:
types: [ created ]
jobs:
publish:
runs-on: ubuntu-latest
environment: ci
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Release
if: github.ref == 'refs/heads/master'
run: ./gradlew release -Prelease.customPassword=${GITHUB_TOKEN} -Prelease.customUsername=${GITHUB_ACTOR} -Prelease.forceVersion=${FORCE_VERSION}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FORCE_VERSION: ${{ github.event.inputs.forceVersion }}
- name: Publish to maven central
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PRIVATE_KEY_PASSWORD: ${{ secrets.GPG_PRIVATE_KEY_PASSWORD }}