-
Notifications
You must be signed in to change notification settings - Fork 7
55 lines (47 loc) · 1.52 KB
/
maven-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
name: Manual Maven Deploy Package
on:
workflow_dispatch:
inputs:
VERSION:
description: 'New Version number'
required: true
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
artifact_name: nats-embedded
steps:
- uses: actions/checkout@v4
- name: Set up JDK 8 for deploy to OSSRH
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '8'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Update package version
run: mvn versions:set -DnewVersion=${{ github.event.inputs.VERSION }}
- name: Publish to Apache Maven Central
run: mvn deploy -PmavenRelease
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Set up JDK 8 for deploy to github packages
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '8'
server-id: github
- name: Publish to GitHub Packages Apache Maven
run: mvn deploy -PgithubRelease
env:
GITHUB_TOKEN: ${{ secrets.NATS_GITHUB_TOKEN }}