-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathdeploy-maven-repository-workflow.yml
More file actions
49 lines (47 loc) · 1.99 KB
/
deploy-maven-repository-workflow.yml
File metadata and controls
49 lines (47 loc) · 1.99 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
46
47
48
49
name: Reusable workflow to deploy in Apache Maven
on:
workflow_call:
inputs:
maven_opts:
type: string
required: false
secrets:
MAVEN_GPG_PASSPHRASE:
required: true
MAVEN_GPG_PRIVATE_KEY:
required: true
jobs:
deploy-workflow:
name: Deploy to Maven and GitHub Packages
runs-on: ${{ vars.UBUNTU_VERSION }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '10'
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '8'
cache: 'maven'
## Future Nacho and Juanfe, please read this very carefully: DO NOT TOUCH!!!
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_NEXUS_USER # env variable for username in deploy
server-password: MAVEN_NEXUS_PASSWORD # env variable for token in deploy
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
- name: Deploy to Maven Central repository
run: mvn clean deploy -DskipTests -Pdeploy-maven ${{ inputs.maven_opts }} --no-transfer-progress
env:
MAVEN_NEXUS_USER: ${{ secrets.MAVEN_USER_TOKEN }}
MAVEN_NEXUS_PASSWORD: ${{ secrets.MAVEN_PASSWORD_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- name: Set up Java for publishing to GitHub Packages
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '8'
- name: Deploy to GitHub Packages repository
run: mvn clean deploy -DskipTests -Pdeploy-github ${{ inputs.maven_opts }} --no-transfer-progress
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}