-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (44 loc) · 1.55 KB
/
maven.yml
File metadata and controls
44 lines (44 loc) · 1.55 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
name: Publish package to the Maven Central Repository
on:
workflow_dispatch: {}
workflow_call:
inputs:
staging_url:
description: Which Nexus server should this workflow publish to
default: https://repository.jboss.org/nexus/
required: true
type: choice
options:
- https://repository.jboss.org/nexus/
- https://origin-repository-nx3.stage.jboss.org/nexus3/repository/releases/
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
with:
ref: trunk
- name: Cache local Maven repository
uses: actions/cache@v3.4.3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven
restore-keys: ${{ runner.os }}-maven
- name: Set up JBoss Staging Repository
uses: actions/setup-java@v4.7.0
with:
java-version: '21'
distribution: 'temurin'
server-id: ${{ inputs.repository }}
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Set Git User Info
run: |
git config --global user.email 'rhc-na-app-dev-practice@redhat.com'
git config --global user.name "GitHub Actions"
- name: Maven Release
run: |
mvn -B release:prepare release:perform -Dnexus.staging.url="${{ staging_url }} -Dpassword="${{ github.token }}" -DtagNameFormat="r@{project.version}"
env:
MAVEN_USERNAME: ${{ secrets.NEXUS_USER }}
MAVEN_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}