-
Notifications
You must be signed in to change notification settings - Fork 8
46 lines (46 loc) · 1.6 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
43
44
45
46
---
name: "Publish to Maven"
on: # yamllint disable-line rule:truthy
release:
types:
- "published"
jobs:
publish:
name: "Publish to Maven"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v4"
- uses: "actions/setup-java@v4"
with:
distribution: "adopt"
java-package: "jdk"
java-version: "17" # LTS
- uses: "bufbuild/buf-setup-action@v1"
with:
version: "1.18.0"
github_token: ${{ github.token }}
# Store the version, stripping any v-prefix
# This lets us use v-prefixed releases
- name: Write release version
run: |
VERSION=${GITHUB_REF_NAME#v}
echo Version: $VERSION
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: "Publish to Sonatype"
env:
ORG_GRADLE_PROJECT_signingKey: "${{ secrets.SIGNING_KEY_ARMORED }}"
ORG_GRADLE_PROJECT_signingPassword: "${{ secrets.SIGNING_PASSWORD }}"
ORG_GRADLE_PROJECT_sonatypeUsername: "${{ secrets.SONATYPE_USERNAME }}"
ORG_GRADLE_PROJECT_sonatypePassword: "${{ secrets.SONATYPE_PASSWORD }}"
run: |
export ORG_GRADLE_PROJECT_release=${VERSION}
./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
- name: Publish JavaDoc
uses: MathieuSoysal/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
javadoc-branch: javadoc
java-version: 17
project: gradle
target-folder: docs
custom-command: gradle javadoc -Prelease=${VERSION}