-
Notifications
You must be signed in to change notification settings - Fork 35
45 lines (38 loc) · 1.2 KB
/
publish-api.yml
File metadata and controls
45 lines (38 loc) · 1.2 KB
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
name: Publish API
on:
push:
tags:
- "api-v*"
permissions:
contents: read
jobs:
publish:
name: Publish liquidjava-api to Maven Central
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Ensure tag is on main
run: |
git fetch origin main
TAG_COMMIT="$(git rev-list -n 1 "$GITHUB_REF_NAME")"
git merge-base --is-ancestor "$TAG_COMMIT" origin/main
- name: Set up JDK 20
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "20"
cache: maven
server-id: central
server-username: CENTRAL_USERNAME
server-password: CENTRAL_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE
- name: Publish API
run: ./mvnw -f liquidjava-api/pom.xml -B --fail-fast -Dgpg.skip=false -Dmaven.deploy.skip=false clean deploy
env:
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
CENTRAL_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}