This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (45 loc) · 1.88 KB
/
java-release.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
name: Release Java API to Maven Central
on:
release:
types:
- published
jobs:
java-release:
runs-on: ubuntu-latest
steps:
- name: Check out repository code from ${{ github.repository }}/${{ github.ref }}
uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
- name: Write gradle.properties
run: |
mkdir -p ~/.gradle
echo "${{ secrets.GRADLE_PROPERTIES }}" | base64 -d > ~/.gradle/gradle.properties
- name: Install gpg secret key
run: |
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
gpg --pinentry-mode loopback --passphrase "${{ secrets.OSSRH_GPG_SECRET_PASSWORD }}" --export-secret-key 568FD16F857171A0EC6D2C40742C84722FD2B235 > ~/.gradle/maven-central.gpg
gpg --list-secret-keys --keyid-format LONG
- name: Update permissions
working-directory: .
run: chmod +x ./gradlew ./.github/scripts/*.sh
- name: Check version
working-directory: .
run: ./.github/scripts/check_version.sh $(echo "${{ github.ref }}" | sed -e "s,^refs/tags/,,")
- name: Build and Publish
working-directory: .
run: |
./gradlew setVersion -P version=$(echo "${{ github.ref }}" | sed -e "s,^refs/tags/,,")
./gradlew build test release --info --stacktrace
- name: Prepare Javadoc locally
working-directory: .
run: ./.github/scripts/prepare_javadoc.sh $(echo "${{ github.ref }}" | sed -e "s,^refs/tags/,,")
- name: Deploy Javadoc to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./${{ github.event.repository.name }}
enable_jekyll: true